links: YDK JS Chapter 2


Objects and Arrays are other object value types in JS, besides primitives

Arrays

let x = [1, "hello"]

JS Arrays can hold any value type, either primitive or object (including other arrays)

Objects

These are unordered keyed collection of any values. You can access the element by a string location name(aka key or property) unlike arrays where you need to pass index.

let me = {
	firstName: "Subramanya",
	lastName: "Chakravarthy",
}

first name can be accessed as me[“firstName”] or me.firstName


tags: javascript , fundamentals