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

Flashcards

Javascript methods

Ben Parish Javascript Inglês 4 flashcards

Flashcards do conjunto (4)

  1. 1What is the difference between the slice( ), splice( ), & split( ) methodsThe slice( ) method copies a given part of an array and returns that copied part as a new array. It doesn’t change the original array.
    array.slice(from, until);
    The splice( ) method changes an array, by adding or removing elements from it. Let’s see how to add and remove elements with splice( ):
    array.splice(index, number of elements);
    array.splice(2);
    The split( ) method is used for strings. It divides a string into substrings and returns them as an array. It takes 2 parameters, and both are optional.
    string.split(separator, limit);
  2. 2What is the difference between call and apply?The difference is that apply lets you invoke the function with arguments as an array; call requires the parameters be listed explicitly. A useful mnemonic is "A for array and C for comma."
    Pseudo syntax:
    theFunction.apply(valueForThis, arrayOfArgs)
    theFunction.call(valueForThis, arg1, arg2, ...)
  3. 3What is the difference between forEach(..), every(..), and some(..)forEach(..) will iterate over all values in the array, and it ignores any callback return values. every(..) keeps going until the end or the callback returns a false (or “falsy”) value, whereas some(..) keeps going until the end or the callback returns a true (or “truthy”) value.
  4. 4What is the difference between Object.keys(..) and Object.getOwnPropertyNames(..)Object.keys(..) returns an array of all enumerable properties, whereas Object.getOwnPropertyNames(..) returns an array of all properties,enumerable or not.

Informações

Descrição
Javascript FlashCards sobre Javascript methods, criado por Ben Parish em 29-05-2019.
Criado por
Ben Parish
Visualizações
1
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?