ITEL 203 - CODUCHUM [JAVASCRIPT(TOPICS 1-5)]

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

1/64

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.

65 Terms

1
New cards

Syntax

programming languages is similar to grammar in spoken languages

2
New cards

Syntax

It's a set of rules for how statements and instructions are correctly structured.

3
New cards

Syntax

These rules dictate how we write and organize JavaScript code, and understanding them is the first step towards writing functional and error-free JavaScript programs.

4
New cards

statement

JavaScript programs are built from instructions called _______

5
New cards

statement

A _________ could be a command that performs a specific action, like displaying something on the screen or performing a calculation.

6
New cards

semicolon ( ; )

Each statement in JavaScript is separated by a _______, much like how we use full stops to separate sentences in English.

7
New cards

Variables

  • a storage container for data values

  • store and manipulate data

  • They allow us to assign values, retrieve them, and perform operations on them

8
New cards

var

  • declare a variable that can be reassigned later

  • has a function scope

9
New cards

var

the original way to declare variables

10
New cards

function-scoped

accessible within the function where they are defined

11
New cards

hoisting

var declarations are moved to the top of their scope

12
New cards

let

  • similar to var, but it has block scope

  • cannot be re declared within the same scope

13
New cards

block scoped

meaning they are only accessible within the block (e.g., within {}) where they are defined

14
New cards

const

  • declare variables that should not be reassigned after their initial assignment

  • has block scope

  • used for variables that should remain constant throughout the program.

15
New cards

Reserved keywords

var, let, const, if, else, for, while, and function

16
New cards

comments

add notes or prevent certain lines of code from executing temporarily

17
New cards

comments

completely ignored by the JavaScript engine, meaning they're for developers' eyes only.

18
New cards

comments

They can be single line or span multiple lines

19
New cards

single line

one line comment

20
New cards

multiline

comments that span multiple lines

21
New cards

linear, top-to-bottom

all JavaScript programs follow a ________ execution model

22
New cards

String

Represents textual data and is enclosed in single or double quotes

23
New cards

Number

Represents numeric values and floating-point, including integers numbers.

24
New cards

Boolean

Represents either true or false

25
New cards

Null

Represents the intentional absence of any object value.

26
New cards

Undefined

Represents a variable that has been declared but not assigned a value.

27
New cards

Descriptive Names

Use this to reflect the purpose of the variable

28
New cards

Camel Case

where the first word is lowercase and each subsequent word starts with an uppercase letter

29
New cards

prompt

displays a dialog box that allows the user to enter data

30
New cards

String

By default, the prompt function returns a ________

31
New cards

parseFloat

collecting numerical input, you should convert the input to a number

32
New cards

toFixed method

This method formats a number to a specified number of decimal places

33
New cards

console.log

It allows us to print messages and values to the console

34
New cards

Template literals

readable and flexible way to embed variables and expressions within strings

35
New cards

backticks (` )

${}

They are enclosed by ________ rather than quotes and allow for easy interpolation of variables using ___ syntax

36
New cards

Arithmetic operators

allow us to perform mathematical operations on numbers

37
New cards

Addition (+) Operator

used to add two numbers together or to concatenate strings

38
New cards

Subtraction (-) Operator

subtract one number from another

39
New cards

Multiplication (*) Operator

multiply two numbers together.

40
New cards

Division (/) Operator

divide one number by another

41
New cards

Modulus (%) Operator

used to find the remainder of the division between two numbers

42
New cards

Exponentiation (**) Operator

  • used to raise a number to the power of another number

  • same operation as using the Math.pow function but is more concise.

43
New cards

increment (++)

increase the value of a variable by 1.

44
New cards

decrement (--)

decrease the value of a variable by 1.

45
New cards

Compound Assignment Operators

+=, -=, *=, /=, and **=

46
New cards

Compound Assignment Operators

perform an arithmetic operation and assign the result to the same variable in a single step

47
New cards

parseInt(string, radix)

Parses a string and returns an integer.

48
New cards

parseFloat(string)

Parses a string and returns a floating-point number.

49
New cards

Number(string)

Can be used to convert both integer and floating-point numbers.

50
New cards

Math.floor()

rounds a number down to the nearest integer.

51
New cards

Math.ceil()

rounds a number up to the nearest integer.

52
New cards

Math.round()

rounds a number to the nearest integer, depending on whether the fraction is greater than or less than 0.5.

53
New cards

Math.random()

generates a random floating-point number between 0(inclusive) and 1 (exclusive).

54
New cards

Math.max()

returns the largest of the numbers provided

55
New cards

Math.min()

returns the smallest of the numbers provided

56
New cards

Comparison operators

compare values and determine their relationship

57
New cards

Comparison operators

commonly used in conditional statements and loops

58
New cards

Equality Operators

used to compare two values for equality

59
New cards

Strict Equality Operator (===)

This operator checks if the values being compared are of the same type and have the same value.

60
New cards

Loose Equality Operator (==)

This operator performs type coercion, meaning it converts the values being compared to a common type before making the comparison. (equality)

61
New cards

Inequality Operators

used to compare two values for inequality

62
New cards

Strict Inequality Operator (!==)

This operator checks if the values being compared are of different types or have different values.

63
New cards

Loose Inequality Operator (!=)

This operator performs type coercion, meaning it converts the values being compared to a common type before making the comparison. (inequality)

64
New cards

Greater Than Operator (>) and Greater Than or Equal Operator (>=)

These operators compare whether one value is greater than or greater than or equal to another value

65
New cards

Less Than Operator (<) and Less Than or Equal Operator (<=)

These operators compare whether one value is less than or less than or equal to another value