Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 530 Bytes

File metadata and controls

23 lines (17 loc) · 530 Bytes

If you ever find yourself writing code like this...

var mentor1 = "Daniel";
var mentor2 = "Irina";
var mentor3 = "Rares";

...then it's probably time to use an array!

Arrays are data structures that hold a list of values.

var mentors = ["Daniel", "Irina", "Rares"];

Arrays can hold any type of value (although almost always you only have one data type per array).

var testScores = [16, 49, 85];
var grades = ["F", "D", "A"];
var greetings = ["Hello, how are you?", "Hi! Nice to meet you!"];