]> git.immae.eu Git - github/fretlink/time-picker.git/commitdiff
SCRIPT5028: Function.prototype.apply: 缺少 Array 或 arguments 对象
authoriceman1212 <iceman_1212@163.com>
Thu, 3 Dec 2015 05:50:07 +0000 (13:50 +0800)
committericeman1212 <iceman_1212@163.com>
Thu, 3 Dec 2015 05:50:07 +0000 (13:50 +0800)
SCRIPT5028: Function.prototype.apply: 缺少 Array 或 arguments 对象

src/module/Panel.jsx

index b91c6febf5b2c8f66101e2fb17f8972fc5c67abb..4c7eaae17048f77b747fe0c6d8544ba608c532d7 100644 (file)
@@ -7,9 +7,11 @@ function noop() {
 }
 
 function generateOptions(length) {
-  return Array.apply(null, {length: length}).map((item, index) => {
-    return index;
-  });
+  const arr = [];
+  for(let i = 0; i < length; i++){
+    arr.push(i);
+  }
+  return arr;
 }
 
 const Panel = React.createClass({