Logo

Programming-Idioms

History of Idiom 134 > diff from v35 to v36

Edit summary for version 36 by justafoo:
[JS] idiomatic js

Version 35

2019-09-26, 18:03:49

Version 36

2019-09-26, 18:04:08

Idiom #134 Create a new list

Declare and initialize a new list items, containing 3 elements a, b, c.

Idiom #134 Create a new list

Declare and initialize a new list items, containing 3 elements a, b, c.

Extra Keywords
array vector slice tuple
Extra Keywords
array vector slice tuple
Code
var items = new Array(a, b, c);
Code
const items = new Array(a, b, c);
Comments bubble
This works fine, but read the doc carefully!
Comments bubble
This works fine, but read the doc carefully!
Doc URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
Doc URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array