How-to: Create an empty object in JavaScript with {} or new Object()? #development #it #dev
How-to: Create an empty object in JavaScript with {} or new Object()? #development #it #dev
Create an empty object in JavaScript with {} or new Object()?
There are two different ways to create an empty object in JavaScript:
var objectA = {} var objectB = new Object()
Is there any difference in how the script engine handles them? Is there any reason to use one over the other?
Similarly it is also possible to create an empty array using different syntax:
var arrayA = [] var arrayB = new…
View On WordPress















