Week 2 - Introduction to JavaScript

0.0(0)
studied byStudied by 15 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/38

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

39 Terms

1
New cards

JavaScript

A programming language that plays a crucial role in web development. It focuses on the behavior of the website.

2
New cards

Vanilla JavaScript

Also known as plain JavaScript, refers to the original, unmodified JavaScript language without any additional frameworks or libraries. It represents the pure version of JavaScript that runs directly in web browsers, relying solely on the language’s built-in methods and objects.

3
New cards

Arrow Functions

Provides a concise syntax for writing function expressions, introduced by ES6.

4
New cards

Template Literals

This allows you to embed expressions inside strings using backticks (`).

5
New cards

Destructing

This allows you to extract values from objects or arrays easily.

6
New cards

<script> tag

It is used to embed or reference JavaScript code within an HTML document.

7
New cards

<script> in the <head> section

When placed here, the script is loaded before the page content, which ensures that it’s available for use throughout the page.

8
New cards

<script> in the <body> section

When placed here, the script is loaded after the page content, which can improve page load performance.

9
New cards

External JavaScript Syntax

<script src = “filename.js”> </script>

10
New cards

document.getElementById()

allows you to select an HTML element based on its unique ID

11
New cards

Fundamental Part of HTML DOM

document.getElementById()

12
New cards

Variables

It is a named container that holds a value. It allows you to store and manipulate data throughout your application.

13
New cards

Use of const variable

Used if the value should not change (especially for arrays and objects).

14
New cards

Use of let variable

Used if you need a mutable variable.

15
New cards

Use of var variable

Used only for older browsers that don’t support let and const.

16
New cards

let

This is used to declare block-scoped variables. This means they are accessible only within that block in which they are defined.

17
New cards

const

This also has a block scope, it is used to declare immutable variables. Only you assign a value to this variable, you cannot change it later.

18
New cards

var

It is used to declare variables.

19
New cards

Scope of var

Its scope are function or global

20
New cards

Scope of let and const

Block scope

21
New cards

Identifier

This starts with a valid character. It is recommended to avoid starting with a number, it is case sensitive, and special characters are not allowed with the exception of underscore and dollar sign.

22
New cards

Undefined Data Type

Denotes a variable that has been declared but not initialized.

23
New cards

Null

Represents an intentional absence of any value.

24
New cards

Symbols

Represents unique and immutable values.

25
New cards

Operators

Have 6 types that allows you to perform different tasks in JavaScript.

26
New cards

Arithmetic Operators

These operators perform mathematical operations on numbers.

27
New cards

Assignment Operators

These operators are used to assign values to variables.

28
New cards

Comparison Operators

These operators compare values and return a boolean result.

29
New cards

String Operators

The operators is used for concatenation or to join strings together.

30
New cards

Logical Operators

These operators are used for logical operations

31
New cards

Ternary Operators

These operators allow you to write concise conditional statements. It takes three operands: a condition, a result for true, and a result for false.

32
New cards

prompt()

This method shows a pop-up dialog box containing a message, an input field for the user to type their input, and two buttons: ‘OK’ and ‘Cancel’.

33
New cards

if statement

This statement allows you to execute a block of code if a specified condition evaluates to true.

34
New cards

if and else statement

These statements allows you to execute different blocks of code based on a condition.

35
New cards

if and else if statement

These statements allow you to test multiple conditions sequentially and execute the corresponding block of code for the first true condition.

36
New cards

switch statement

This statement provides an efficient way to handle multiple cases based on the value of an expression. It evaluates and compares it against various cases. If a match is found, the corresponding block of code is executed.

37
New cards

for loop

This loop allows you to execute a block of code repeatedly for a specified number of iterations.

38
New cards

while loop

This loop executes a block of code as long as a specified condition remains true.

39
New cards

do-while loop

This loop executes the code block at least once, and then continues as long as the specified condition is true.