JavaScript Lingo: Arrays & Objects

preview_player
Показать описание
How to identify an array or an object based on simple syntax, as well as what they are capable of doing.

If you want to store more than one piece of information to a variable, you can do so by creating an array or an object.

**Disclaimer: Objects in JS are not exactly the same as objects in other languages. We will discuss objects here as they pertain to JS.

Arrays are sets of data between [square, brackets]. Data is separated by commas. That data can be in the form of a boolean, string, number, or even another array. We call that a nested array.

Objects are a type of data that can look or behave similar to an array in the way that it's more data stored in one variable in an organized way. You'll hear it referred to as JSON, and when you make API calls to other sites (getting information to display on your own page) it will frequently be returned in JSON.

An example of object notation is:
var obj = {
"name" : "Briana",
"food" : "cheese",
"dog" : "Maurice"
};

Notice the curly brackets, the 'keys' with values like name or food,, and the value called a 'property' that is tied to the 'key', like Briana or cheese. These are ALL stored as strings, although booleans, numbers, and other types of data are also valid.
Рекомендации по теме
Комментарии
Автор

very nice channel thank for ur efforts

sallaklamhayyen
Автор

Loved this simple explanation. 🎉 You rock 😀

anumehaayushi
Автор

Pretty Nice!
You forgot the semicolon at the very end of the 'array :D

mihai
Автор

Notice the curly brackets here, aahaan hahhaha. That was funny.

gulshansharma
Автор

I'm confused. I've heard keys used interchangeably with properties, and key-value pairs used interchangeably with properties. Now she's calling the values of an object, properties? Can anyone explain?

wahtthepho
Автор

Mam what's ur name iwant more tutorial from u... Do u hve youtube channel

vikasni
Автор

Hi ..thanks for teaching java script .. so you are very beautiful ... i like your beauty and you so coool ..i am also in software developing ..

sukhjitsingh