From 67a8cc6ef19e70d3bcfb41766edd6e0ce032d575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A3=8A?= Date: Thu, 17 Jan 2019 11:54:59 +0800 Subject: [PATCH] update tutorial --- tutorial/spread-operator.cn.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tutorial/spread-operator.cn.md b/tutorial/spread-operator.cn.md index 4c11a245c..7dcf35042 100644 --- a/tutorial/spread-operator.cn.md +++ b/tutorial/spread-operator.cn.md @@ -4,6 +4,14 @@ Spread Operator 是我最喜欢的语法糖,没有之一,在应用场景上 这是对应的 [babel 插件](https://babeljs.io/docs/en/next/babel-plugin-proposal-object-rest-spread.html),当然直接使用 typescript 或者直接使用 omi-cli 已经内置了这个特性,可以直接使用。 +### JSX 里的 for 循环 + +```js +{[...Array(10)].map((x, i) => ( +
{i}
+))} +``` + ### 不使用 Apply apply 和 call 可以执行函数,改变 this 执行,比如: