Sign in

Passionate reading || Coding Addicted || FullStack Web Developer from Costa Rica
Photo by Markus Spiske on Unsplash

Functions as Values

const square = function(x) {
return x*x;
}
console.log(square(12))
// --> 144

Functions with declaration Notation


Photo by Ian Schneider on Unsplash

Photo by Joshua Aragon on Unsplash
cosnt number = -4;
if(number > 0){ //Conditional execution
console.log(`Number ${number} is positive.`)
}else {
console.log(`Number ${number} is negative.`)
}
let number = 0;
while(number <= 4){ //Conditional execution
console.log(`Count: …

Photo by Roman Synkevych on Unsplash
const sum = function(numberOne, numberTwo){
return numberOne + numberTwo;
}
console.log(sum(5,4))
//output -> 9

Photo by Joshua Aragon on Unsplash

Let


Photo by Caspar Camille Rubin on Unsplash

Expressions

let x = 7 // produce variable x -> with side effects
3+4 //produce 7 as a result -> resolve to a value
5 //produce 5 -> resolve to a value

Photo by Christopher Gower on Unsplash

What is an empty value?

Null

let emptyValue = null; //Binding
console.log(emptyValue) // output -> null
typeof null //output -> "object" //Javascript bug

Photo by Pankaj Patel on Unsplash
console.log(true && false); // -> && and operator
//output -> false
console.log(true && true);
//output -> true
console.log(false || true); // -> || or operator //output -> true…

3 > 2
// true
5 >= 7
//false
true == 1
//true
false == 0
//true


Photo by Christopher Robin Ebbinghaus on Unsplash

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store