.push()
returns the new length of the array.
['one'].push('two'); // returns 2 (array length is 2)
['one', 'two'].push('something'); // returns 3 (array length is 3)
In your case:
[].push([]); // array length is 1 where you get array within array. [[]]
More Related Contents:
- How do I change the text of a div when I hover over a button?
- What is the purpose of wrapping whole Javascript files in anonymous functions like “(function(){ … })()”?
- Generate pdf from HTML in div using Javascript
- Access object child properties using a dot notation string [duplicate]
- Bootstrap modal appearing under background
- How might I find the largest number contained in a JavaScript array?
- JavaScript function declaration and evaluation order
- Changing the key name in an array of objects?
- How to sort array inside collection record in MongoDB?
- Removing all script tags from html with JS Regular Expression
- Javascript read file without using input
- Invariant Violation: _registerComponent(…): Target container is not a DOM element
- Incorrect result in JavaScript calculation [duplicate]
- How to get size of an element/list in Firebase without get it all?
- How to insert variables in JavaScript strings?
- Automatically created variables from ids in JS? [duplicate]
- Will async/await block a thread node.js
- How do I change the value of a global variable inside of a function
- putting html inside an iframe (using javascript)
- When should I use brackets with imports
- Converting large numbers from binary to decimal and back in JavaScript
- Every Object is a function and every function is Object – Which is Correct?
- Checking password match while typing
- Get JSON in a Chrome extension
- What algorithm does Readability use for extracting text from URLs?
- How can one get the file path of the caller function in node.js?
- Is John Resig’s Javascript inheritance snippet deprecated?
- Why is pop faster than shift?
- R networkD3 package: node coloring in simpleNetwork()
- How to compare Unicode strings in Javascript?