scrimba
Yet Another Programming Course
010 - Basic Data Types
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

010 - Basic Data Types
AboutCommentsNotes
010 - Basic Data Types
Expand for more info
javascriptSamples.js
run
preview
console
// Javascript Examples
let j = 5, s = 3;

// console.log('The int division of 5/3 is: ' + parseInt(j/s));
// console.log('The float division of 5/3 is: ' + j/s);

// Text Examples
let myString = "Hello from Javascript!";

// console.log(myString);
// console.log(myString[11]);
// myString = "Coffee, coffee, coffee..."
// console.log(myString);
// myString[0] = 'J';
// console.log(myString);


// Boolean Examples
let isTall = true, isAsleep = false;

// console.log("Am I tall? " + isTall);
// console.log("Am I asleep? " + isAsleep);
// console.log("Am I NOT asleep? " + !isAsleep); // ! means NOT
// console.log("Am I tall OR asleep? " + (isTall || isAsleep));
// console.log("Am I tall AND asleep? " + (isTall && isAsleep));


// const
const CONST_STRING = "I'm adverse to change.";
//CONST_STRING = "Some other string";

// Typeof
// console.log("x is a: " + typeof x);
// console.log("ParseInt(x/y) is a: " + typeof parseInt(x/y));
// console.log("myString is a: " + typeof myString);
// console.log("CONST_STRING is a: " + typeof CONST_STRING);
// console.log("isTall is a: " + typeof isTall);






console.log();
Console
"P "
,
"Snakes!!! "
,
/index.html
-18:43