JavaScript

Description

JavaScript Flashcards
Jonathan Sequeira
Flashcards by Jonathan Sequeira, updated more than 1 year ago
Jonathan Sequeira
Created by Jonathan Sequeira over 5 years ago
67
0

Resource summary

Question Answer
What is the var statement? The var statement declares a global scope variable
What is the let statement? The let statement declares a block scope local variable
what is the const statement? Constants are block-scoped, much like variables defined using the let statement. The value of a constant cannot change through re-assignment, and it can't be re-declared.
How do you display to the console? console.log();
What are the mathematical operators? (+) = plus (- )= minus (/) = division no remainder (%) = Modulus remainder
What is the purpose of an Assignment Operator? Uses the current value of a variable, and adds another value
What is string interpolation? The JavaScript term for inserting data saved to a variable into a string
`What are back ticks ?` Same as typing a string but you can insert variables though formatting with `${Variable}`
What is an if statement? An if statement takes a parameter with a Boolean expression if condition is true it executes the block of code
What is an else statement? An else statement is followed by an if statement it is a block of code that is executed when the condition in the if statement is false
In JavaScript, all values have a truthy or falsy value what variables return false? False, 0 & -0, "" & '', null, undefined, NaN
What does the !not operator do? The !not operator makes a true statement false and false statement true
What are the comparison operators and what do they return? < , >, <=, >= These Operators return true or false
What are the comparison operators and what do they do? "===" Checks if two values are equal to each other "!==" Check if two values are not equal to each other
What is an "else if" statement? An else if statement checks another Boolean condition when a previous condition is false
What is the structure of a switch statement? switch (variable) { case 'possible condition' : "block of code to execute" break; case 'possible condition' : "block of code to execute" break; default: "block of code to execute" break; }
What are the logic operators? && , ||
What is a Ternary Operator? converts a simple if/else structured block into a single line short hand ex. Boolean value ? if true execute this : else execute this;
What is the structure of an arrow function? cons function name = (parameter) => { Code block to execute }; a function can have as many parameters needed
What is the return keyword? The return keyword returns a value inside of a function
What is the Structure of a Function Declaration function "name" (parameter) { code block }
What is the Structure of a Function Expression? const name = function (parameter) { code block }; Function Expressions omit the identifier following the function key word usually stored in variables
Refactoring Arrow Functions Functions that take a single parameter do not need a parenthesis, a return, or brackets. An implicit return occurs
How do you declare an array? let "name" = [Array Elements];
How do you return the amount of elements in an array? array.length;
How do you access an index of an array? array[index];
How do you re-assign an element value? array[index] = "value";
What does the push method do? array.push(parameter); Takes the values of the parameters and pushes those elements to the end of the array elements.
What does the pop method do? array.pop() The pop() method removes the last element from an array and returns that element. This method changes the length of the array.
What does the shift method do? The shift() method removes the first element from an array and returns that removed element. This method changes the length of the array.
What does the slice method do? The slice(from index, to index) method returns a a new string by extracting the index range of he original array. The original array will not be modified.
What does the splice method do? The splice(index selected, amount of elements to be removed, replacement value) method changes the contents of an array by removing existing elements and/or adding new elements.
What does the splice method do? The join() method joins all elements of an array (or an array-like object) into a string and returns this string.
Show full summary Hide full summary

Similar

Javascript - Quiz - Jan 2016
arunram.krish
Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush