O GoConqr está de visual novo! Conte para nós o que você achou.

Flashcards

ECMA6

Ben Parish Javascript Inglês 9 flashcards

Flashcards do conjunto (9)

  1. 1What are the new features of ECMA6?1. const vars
    2. 'symbol' variable type
    3. 'let' keyword
    4. default parameter values.
    5. destructuring
    6. concise methods
    7. computed properties
    8. arrow functions
    9. block scoping
    10. promises
    11. generators
    12. iterators
    13. First-class support for modules
    14. proxies
    15. weakmaps
  2. 2What is a polyfiller and give some examples of polyfillersThe word “polyfill” refers to taking the definition of a newer feature and producing a piece of code that’s equivalent to the behavior, but is able to run in older JS environments.
    ES5-Shim and ES6-Shim.
  3. 3What is a transpiler and give examples of some transpilersA tool that converts your newer code into older code equivalents. This process is commonly called “transpiling,” a term for transforming + compiling.
    Babel and Traceur
  4. 4What is a block scope?Block scope refers to the idea that variables and functions can belong to an arbitrary block (generally, any { .. } pair) of code, rather than only to the enclosing function.
  5. 5What are 'computed property names'?Where you can specify an expression, surrounded by a [ ] pair, in the key-name position of an object-literal declaration:
    var prefix = "foo";
    var myObject = {
    [prefix + "bar"]: "hello",
    prefix + "baz"]: "world"
    };
    myObject["foobar"]; // hello
    myObject["foobaz"]; // world
  6. 6What if you want to iterate over the values directly instead of the array indices (or object properties)?for..of loop syntax for iterating over arrays (and objects, if the object defines its own custom iterator):
    var myArray = [ 1, 2, 3 ];
    for (var v of myArray) {
    console.log( v );
    }
    // 1
    // 2
    // 3
  7. 7What is this the equivalent of? accounts => account0 = accounts[0]function (accounts) {
    account0 = accounts[0];
    }
  8. 8What is a variadic function?A variadic function can take varying parameters. You can define variadic functions via "rest" parameters.
    function list(heading, ...items)({..}
    list('Ducks', 'Huey', 'Luey', 'Duey')
    items is treated like an array.
    for (let item of items){..}
  9. 9What is the difference between a rest and spread operator?Both use ... in different ways
    Rest parameter: collects all remaining elements into an array.
    arguments -> array
    function xyz(x, y, ...z) {
    console.log(z); // ["wassup", "goodmorning", "hi", "howdy"]
    }
    xyz("hey", "hello", "wassup", "goodmorning", "hi", "howdy")
    Spread operator: allows iterables( arrays / objects / strings ) to be expanded into single arguments/elements.
    array -> arguments
    const arr = ["Joy", "Wangari", "Warugu"];
    const newArr = ["joykare", ...arr];
    The value of newArr will be [ 'joykare', 'Joy', 'Wangari', 'Warugu' ]

Informações

Descrição
Javascript FlashCards sobre ECMA6, criado por Ben Parish em 09-05-2019.
Criado por
Ben Parish
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?