<<<<<<< HEAD Midterm Study

Midterm Study

Introduction to Web Pages

  1. A web page is a container for the following three technologies. Describe the purpose of each for a web page:

Answers:


Introduction to javascript

  1. Browser pop-up dialogue box functions

Answers:


Data Types and Variables

  1. Name JavaScript's three data types. Describe the types of data they store
  2. JavaScript is a weakly-typed language. Describe what this means.
  3. What are the naming rules for a variables name? What are naming conventions?
  4. What is a constant in JavaScript? Describe how you would declare a JavaScript constant.

Answers:

  1. Number, String and Boolean
  2. weakly-typed language implies that data types do not need to be defined at initialization, the compiler will decide, cast and convert the data type unless explicitly cast
  3. A naming convention is a recommended way of naming variables to ensure readability and organize code. JavaScript uses camelCase for variables and classes and UPPER_SNAKE_CASE for constants
  4. let customerAge = 23;
    const ONT_TAX_RATE = 0.13;
  5. A constant is a variable whose value cannot be changed once initialized, making it constant. To define a constant, use the "const" keyword.

Operators

  1. Explain the following binary operators: + - * / %
  2. Explain the multiple uses of the + operator.
  3. Describe how the increment/decrement operators (++ and --) work.

Answers:

  1. The + operator is used to get the sum, the - operator is to get the difference, the * operator multiplies, the / operator divides and the % (modulus) operator determines if two numbers divided have a remainder and how much of one
  2. The + operator can be used to add two numbers together to find their sum, or you can use it to concatenate multiple Strings together.
  3. The ++ (increment) operator is used to increase the value of a variable by exactly one. The -- (decrement) operator is used to decrease the value of a variable by exactly 1.

The JavaScript Math object

  1. Describe the operation and the return for the following Math methods:

Answers:


JavaScript Number Methods

  1. Describe the operation and the return for the following Number methods:

Answers:


JavaScript Global Functions

  1. Describe the operation and the return for the following global functions:

Answers:


JavaScript String Methods

  1. Describe the operation and the return for the following String methods.

Answers:

Playground

Interactive JavaScript follows

======= Midterm Study

Midterm Study

Introduction to Web Pages

  1. A web page is a container for the following three technologies. Describe the purpose of each for a web page:

Answers:


Introduction to javascript

  1. Browser pop-up dialogue box functions

Answers:


Data Types and Variables

  1. Name JavaScript's three data types. Describe the types of data they store
  2. JavaScript is a weakly-typed language. Describe what this means.
  3. What are the naming rules for a variables name? What are naming conventions?
  4. What is a constant in JavaScript? Describe how you would declare a JavaScript constant.

Answers:

  1. Number, String and Boolean
  2. weakly-typed language implies that data types do not need to be defined at initialization, the compiler will decide, cast and convert the data type unless explicitly cast
  3. A naming convention is a recommended way of naming variables to ensure readability and organize code. JavaScript uses camelCase for variables and classes and UPPER_SNAKE_CASE for constants
  4. let customerAge = 23;
    const ONT_TAX_RATE = 0.13;
  5. A constant is a variable whose value cannot be changed once initialized, making it constant. To define a constant, use the "const" keyword.

Operators

  1. Explain the following binary operators: + - * / %
  2. Explain the multiple uses of the + operator.
  3. Describe how the increment/decrement operators (++ and --) work.

Answers:

  1. The + operator is used to get the sum, the - operator is to get the difference, the * operator multiplies, the / operator divides and the % (modulus) operator determines if two numbers divided have a remainder and how much of one
  2. The + operator can be used to add two numbers together to find their sum, or you can use it to concatenate multiple Strings together.
  3. The ++ (increment) operator is used to increase the value of a variable by exactly one. The -- (decrement) operator is used to decrease the value of a variable by exactly 1.

The JavaScript Math object

  1. Describe the operation and the return for the following Math methods:

Answers:


JavaScript Number Methods

  1. Describe the operation and the return for the following Number methods:

Answers:


JavaScript Global Functions

  1. Describe the operation and the return for the following global functions:

Answers:


JavaScript String Methods

  1. Describe the operation and the return for the following String methods.

Answers:

Playground

Interactive JavaScript follows

>>>>>>> a2ad5843006c62096be10203d3f91faa39f365fb