1 of 13

JAVASCRIPT

01: ORIENTATION

Welcome to the Coding Power JavaScript class!

2 of 13

WHAT IS CODING POWER?

Coding Power is a community program aimed to empower youth through coding and providing resources to those who desire to code. We work with local schools and libraries to promote interest in computer science, especially among underrepresented groups.

3 of 13

WHAT IS JAVASCRIPT?

JavaScript is…

  • One of the most popular languages
  • Beginner-friendly
  • Essential for anyone in the computer science field
  • 99% of websites use it with HTML & CSS
  • Used in Instagram, Reddit, Facebook, Netflix, etc.

4 of 13

WEEKLY SCHEDULE

Week 1: Orientation

Week 2: Fundamentals

Week 3: Strings

Week 4: Flow

Week 5: Methods

Week 6: Arrays

Week 7: Objects

Week 8: Review

5 of 13

ICEBREAKERS

What is your name, grade, school, and favorite animal and why?

CREDITS: This presentation template was created by Slidesgo, and includes icons by Flaticon, and infographics & images by Freepik

6 of 13

RECOMMENDED SUPPLIES

  • Computer with working camera and internet
  • Positivity :D
  • Take a moment to grab everything!

7 of 13

BASIC RULES

  1. End lines with a semicolon ;
  2. Things run in order top-down
  3. Everything is case-sensitive (capitals matter!)
  4. All parenthesis/brackets/quotes must be matched ( ) { } [ ] < > “ ” ‘ ’
  5. Camel Case, first word lowercase, the rest uppercase, thisIsAnExample!

8 of 13

JAVASCRIPT SYNTAX

// Defining

var x;

let y = 0;

// Using

x = 5;

y = 6;

const z = x + y;

  • To define, use var, let, or const
    • var (variable) works in a function
    • let works in a block
    • const (constant) cannot change
  • To change, simply use equal
  • // is a comment, computer skips it

9 of 13

CONSOLE LOG

let x = 15;

console.log("Hello World!");

console.log("Coding " + "Power!");

console.log("I am " + x + " years old.");

  • console.log prints things to the console
  • Console is like the output area
  • Anything in quotes gets printed exactly
  • Anything not in quotes references a variable
  • Use “+” to combine things

10 of 13

WHAT ARE ESCAPE CHARACTERS

  • Use a backslash \ to indicate an escape character inside of a string
  • Here are some examples:
    • \n to create a new line
    • \r to create a carriage return (tab)
    • \\ to create a \
    • \' to create a '
    • \" to create a "

console.log("I’m \\ using \n\"escape characters\"");

11 of 13

USES OF ESCAPE CHARACTERS

let x = 15;

console.log("Hello World!");

console.log("Coding " + "Power!");

console.log("I am " + x + " years old.");

var x = 15;

console.log("Hello World!\n"+ "Coding " + "Power!\n" + "I am " + x + " years old.");

  • otherwise cannot use symbols like \, ', "
  • escape characters like \n can save space

12 of 13

TRY IT YOURSELF

Go to onecompiler.com/javascript

let x = 15;

console.log("Hello World!");

console.log("Coding " + "Power!");

console.log("I am " + x + " years old.");

13 of 13

THANKS!

Any questions?

codingpower101@gmail.com

codingpower.org