JSFiddle - React, Tailwind, and code Playground

JavaScript

var cars = [];
cars[5] = 'Volvo';
cars[10] = 'Honda';
cars[11] = 0; //falsy value for testing

console.log(

    $.map(cars, function(v) {
        return v;
    })

);