We began our day with functions, object and arrays. A function in JavaScript is a block of code written to act and it can be reused. E.g.:
function myFunction(x, y, z){
return x + y * z;
}
Object is a data type in JavaScript and a data structure. It can contain many values with different data types even method(function); E.g:
var person = { name: "John",
age: 38,
isMarried: false,
hello: function() { return "Hello " + this.name;
}
};
An array stores data in a single variable and often similar data.
E.g: var listOfColors = ["green","yellow","red"];
We did exercises using a different method in small groups. It was helpful, learned from each other.
Jean Cédric NTWARI