[1,2,3].map((x) => { let y = x + 1; return x * y; });
[1,2,3].map(x => x * x)
function httpMagicObject() { } ['get', 'post', 'put'].map(httpMethod => ( Object.prototype.hasOwnProperty.call( httpMagicObject, httpMethod ) ))
import { nameA, nameB, nameC ... } from 'path'
const luke = { jedi: true, age: 28, }; function getProp(prop) { return luke[prop]; } const isJedi = getProp('jedi');
使用 +=或者-=來替代自增或者自減運算符數組