46
loading...
This website collects cookies to deliver better user experience
var string = "I am text information that is being represented."
var boolean = true;
var boolean = false;
var number = 15;
var number = 1.5;
var variableThatWasNeverAssignedAValue; // --> undefined
var variableThatIsIntentionallyAssignedNoValue = null;
var array = [1, 2, 3];
var array = [1, 'some string', false];
var array = [[1, 2, 3], [4, 5, 6];
var array = [1, 2, 3];
array.forEach(...);
var obj = {
someKey: 123,
anotherKey: 456,
};
var obj = {
someKey: 123,
anotherKey: 456,
};
obj.someKey // --> 123
obj['someKey'] // --> 123
// also
obj.anotherKey // --> 456
obj['anotherKey'] // --> 456
obj.anotherKey
) or bracket notation (obj['anotherKey']
). These are just two different means to the same end according to the rules of JavaScript.function putMeInCoachImReadyToPlay() {
alert('Batter Up!');
}
()
.putMeInCoachImReadyToPlay() // --> alerts "Batter Up!"
()
as pressing the play button on a remote.function putMeInCoachImReadyToPlay(name) {
alert(`${name}, Batter Up!`);
}
putMeInCoachImReadyToPlay('Nick') // --> alerts "Nick, Batter Up!"