blog
Back to top

Category: Arrays

  • 22
    Sep
    2017

    Weird behaviour of “new Array()” in Javascript?

    When I’m playing around with Javascript arrays, I have noticed some weird behaviour of an array constructor. Let’s look into it deeply..
    How to create a JavaScript Array?
    In Javascript, we can create an array using either

    • Array literals or
    • Array Constructor

    Let’s start with the best way: Array Literals
    I as a developer, regularly use this way:

    
    var arr = [1,2,3];


    READ MORE