1, foo: 2 } // × property name foo appears more than once in object // literal function f(bar, bar) { return bar; } // × duplicate formal argument bar var sum = 015 + // 8 進数リテラル (誤用) 197 + 142; // × octal literals and octal escape sequences are // deprecated https://developer.mozilla.org/en/JavaScript/Strict_mode
b = 10; // let 式・文: let (...) に続く式・文中だけで有効 let (a = 100, c = 300) console.log(a); // -> 100 // for 文などでの let for (let a=0; a<3; a++) { console.log(a+b); // -> 10, 11, 12 } console.log(a); // -> 1 } console.log(a); // × ReferenceError: a is not defined http://wiki.ecmascript.org/doku.php?id=harmony:let
}; var ch={ name:"Chrome", vendor:"Google", ver:19 }; var browsers={ firefox: fx, chrome: ch } // 欲しいプロパティだけ一括代入 var { name: n, ver: v } = fx; // -> n="Firefox", v=13 // for-each-in などとの組み合わせも for each ( let { vendor: ven, ver: ver } in browsers ) console.log(ven) // -> "Mozilla", "Google"