Javascript ES6 Flashcards
function that allows a short syntax for writing function expressions.
Arrow Function
hello = () => {
return “Hello World!”;
}
The statement that allows you to declare a variable with block scope.
let
The statement that allows you to declare a variable with a constant value
const
A type of function, but instead of using the keyword function to initiate it, we use a different keyword, and the properties are assigned inside a constructor() method.
Class class Car { constructor(brand) { this.carname = brand; } }
Giving function parameters default values
function mine(x, y = 10) { }
Array method that returns the value of the first array element that passes a test function
find() var numbers = [4, 9, 16, 25, 29]; var first = numbers.find(myFunction);
function myFunction(value, index, array) { return value > 18; }
Array method that returns the index of the first array element that passes a test function
findIndex() var numbers = [4, 9, 16, 25, 29]; var first = numbers.findIndex(myFunction);
function myFunction(value, index, array) { return value > 18; }
Number property that represents the difference between 1 and the smallest floating point number greater than 1. It has the value of 2.2204460492503130808472633361816E-16, or 2-52.
Number.EPSILON
Number property that represents the minimum safe integer in JavaScript (-(2^53 - 1))
Number.MIN_SAFE_INTEGER
Number property that represents the maximum safe integer in JavaScript (2^53 - 1)
Number.MAX_SAFE_INTEGER
Number method that determines whether the passed value is an integer
Number.isInteger()
Number method that determines whether the passed value is a safe integer
Number.isSafeInteger()
Global Number method that determines whether the passed value is a finite number
Number.isFinite()
Global Number method that determines whether a value is NaN (not-a-number)
Number.isNaN()
Exponentiation operator to raise the first operand to the power of the second operand and produces the same result as Math.pow()
**