Objects and Functions in Javascript — JS Wall
Apr 23, 2021
JavaScript objects are containers for named values called properties or methods. Key-Value Pair.
Objects are variables too. But objects can contain many values.
This code assigns many values (Fiat, 500, white) to a variable named car:
var car = {type:”Fiat”, model:”500", color:”white”};
car.type = ‘Fiat’
car.values=[‘Fiat’, ‘500’, ‘white’]
car.keys=[‘type’, ‘model’, ‘color’]
Function —
To create a function we use the keyword function