Intro to JavaScript

Nick DeJesus

Just kidding

AGENDA

  • What is JS
  • JS history
  • JS Basics (Syntax)
  • Variabels
  • Arithmetic 
  • Conditionals

What is js?

  • Language of the Web
  • Used for bringing web pages to life
  • Manipulates HTML and CSS
  • Can be used for damn near everything
  • Servers (Node)
  • Databases (Mongo)
  • Mobile (React Native (my fave))
  • AI (Tensorflow)

Brief History of JS

JS

Brief History of JS

  • Made by Brendan Eich
  • Made it in 10 days as a prototype
  • Naming it JavaScript was a marketing ploy

Let's look at some code!

Comparing Numbers

Loops

Loops allow you to run repeatable tasks without having to manually write it all out yourself

Loops

Print "Hello World" to the console 10 times

console.log("Hello World)"
console.log("Hello World)"
console.log("Hello World)"
console.log("Hello World)"
console.log("Hello World)"
console.log("Hello World)"
console.log("Hello World)"
console.log("Hello World)"
console.log("Hello World)"
console.log("Hello World)"

Loops

Print "Hello World" to the console 10 times

for(let i = 0; i <= 10; i++) {
  console.log('Hello World";
}

Functions

 

Functions are instructions for your browser to follow

Function Syntax

 

function yourFunctionNameHere() {
  //things you want your function to do here
}

or

yourFunctionNameHere = () => {
  //things you want your function to do here
}

Function DeClaration

 

function addNumbers(firstNumber, secondNumber) {
  // What do you think happens in here?
}
function addNumbers(firstNumber, secondNumber) {
  return firstNumber + secondNumber;
}
function addNumbers(firstNumber, secondNumber) {
  return firstNumber + secondNumber;
}

Function CALl

 

function addNumbers(firstNumber, secondNumber) {
  return firstNumber + secondNumber;
}
addNumbers(2, 3)

// 5

ChallengeS

Made with Slides.com