Things about JavaScript

E Ma
Nov 5, 2020

--

{} and [] in Javascript

{} declare an array.

[] declare an object.

An array is an object so it has all the same capabilities of an object plus a bunch of additional features for managing an ordered, sequential list of numbered indexes starting from 0 and going up to some length.

Array are typically used for:

An ordered list of items that are accessed by numerical index. (lots of features to manage the order of the list or to add or remove things from the list)

JavaScript file extension .Jsx VS .ts VS .js

Plain JavaScript use .js

Anything is not plain JavaScript use .jsx

.ts for TypeScript

--

--