
JavaScript Introduction
Presentation
•
Computers
•
Vocational training
•
Practice Problem
•
Medium
Sudo Aldrich
Used 12+ times
FREE Resource
25 Slides • 13 Questions
1
JavaScript
2
Programming language for the web
An interpreted programming language
Used for creating interactive web pages
Could be used as a server-side programming language using Nodejs, Deno, or Bun
What is JavaScipt?
3
Created in just 10 days by Brendan Eich for Netscape Navigator
Originally named Mocha
There's no actual relation to Java
One of the most popular languages
Runs everywhere
Supports multiple programming paradigms (Object-Oriented, Functional, and Procedural)
Asynchronous by Nature
Cool facts about JavaScript
4
Multiple Choice
JavaScript is not
Compiled
Asynchronous
Object-Oriented Programming
Client-Side programming language
5
Multiple Choice
JavaScript is related to Java
Yes
No
6
Where is the output?
JavaScript output could be shown in...
1. HTML. Using DOM API
2. Dialog. Using `alert`
3. Console. Using `console` API.
7
DOM/HTML Output
8
alert / Browser Dialogs
9
Console Outputs
10
Running JavaScript using <script> tag
<script> tag could be used anywhere in the html file
11
Running external JavaScript using <script> tag
12
In JavaScript statements are separated by semicolons (;)
JavaScript Syntax
13
JavaScript Comments
14
JavaScript Blocks
JavaScript could grouped together by using code blocks.
In JavaScript, we're using curly braces to indicate code blocks.
15
JavaScript Blocks
16
The var keyword was used in all JavaScript code from 1995 to 2015.
The let and const keywords were added to JavaScript in 2015.
The var keyword should only be used in code written for older browsers.
JavaScript Variables
17
JavaScript Variables
18
Fill in the Blanks
19
Multiple Choice
What is the correct way to create a multi-line comment
20
Multiple Choice
What is the output of the code?
ReferenceError: color is not defined
yellow
undefined
"yellow"
21
Multiple Choice
What is the value of color?
blue
green
SyntaxError: Identifier 'color' has already been declared
22
JavaScript Arithmetic
23
JavaScript Assignment
24
JavaScript Data Types
Boolean (true or false)
Number (64-bit floating point)
BigInt (A new data type introduced in ES2020)
String (Any text)
Undefined (A variable/type that is undefined)
Null (Represents absence of value)
Object (A variable that may contain properties)
Symbol (Guaranteed unique value)
25
JavaScript Data Types are Dynamic
26
Multiple Choice
What is the value of color?
Null
Symbol(color)
False
Undefined
27
Multiple Choice
What is the value of "total"?
10
1010
Error
"1010"
28
Multiple Choice
What is the value of "total"?
"0"
0
Error
29
Multiple Choice
`!!` is used to convert any truthy or falsy value to boolean.
In this case, what is the value of "a"?
True
False
30
Multiple Select
Select correct ways to get a property from an object
a.name
a['name']
a.get('name')
a.getName()
const { name } = a
31
JavaScript Function
32
DOM API
DOM stands for Document Object Model
A platform and a language neutral interface to access and modify content, structure, and style of a document
33
DOM API: Selecting an Element
34
DOM API: Changing Elements
35
DOM API: addEventListener()
`addEventListener()` would allow us to attach functions to a DOM elements events.
Common events are:
- click
- mouseover
- submit
Full List at https://www.w3schools.com/jsref/dom_obj_event.asp
36
DOM Manipulation
37
Multiple Choice
To select button using DOM API we must use...
document.getElementById("button1")
document.getById("button1")
document.getElementById("#button1")
document.getElement("#button1")
38
Multiple Select
Choose all the correct ways to select the button
document.getElementsByClassName("btn btn-primary")
document.querySelector("button[class='btn btn-primary']")
document.getElementById("btn btn-primary")
document.querySelector(".btn.btn-primary")
JavaScript
Show answer
Auto Play
Slide 1 / 38
SLIDE
Similar Resources on Wayground
38 questions
Dzieje Apostolskie - rozdziały 13-20
Presentation
•
Professional Development
27 questions
TSC WOW Warrior Brain It On
Presentation
•
Professional Development
29 questions
Working with computers
Presentation
•
KG - University
31 questions
Beginning Teachers PL Day
Presentation
•
Professional Development
35 questions
Mission: Immersion Possible
Presentation
•
Professional Development
31 questions
The conference
Presentation
•
Professional Development
29 questions
InTASC Standard 7 - Zoe C
Presentation
•
Professional Development
31 questions
Unfolding Case Study
Presentation
•
KG - University
Popular Resources on Wayground
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
6 questions
Marshmallow Farm Quiz
Quiz
•
2nd - 5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade