Fundamental Vanilla JavaScript

let name = ‘DJ’;

let myHeight = 72;

myHeight = 75;

console.log(myHeight);

**Here’s 2 variables**

let name = ‘DJ’;

let age = 25;

**These variables are related because they’re part of a person, so instead of declaring two variables, we can declare a person object. This will allow us to reference the person object rather than these two different variables**

let person = {

name: ‘DJ’.

age: 25

};

let roomColors = [white, black, beige]

let roomColors = [white, black, beige];

roomColors[3] = ‘green’;

console.log(roomColors);

function greet() {

console.log(‘Hello World’);

}

greet();

function greet(name) {

console.log(‘Hello ’+ name);

greet(‘DJ’);

function greet(name, lastName){

console.log(‘Hello ’ + name + ‘ ’ + lastName);

greet(‘DJ’, ‘Draper’)

--

--

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