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

Flashcards

Javascript adv

Alexander Lynds Inglês 11 flashcards

Flashcards do conjunto (11)

  1. 1How do you check if an object has a property?objName.hasOwnProperty("prop");
    Useful for putting variables in the prop check too.
    returns true or false
  2. 2how do you generate a random number?Math.random();
    generates decimal 0.0 - 0.99
  3. 3How do you generate a random number between 0 and 20?Math.floor(Math.random() * 21);
    (floor round down number)
  4. 4What is the formula for random generating a # between a min and max range? Ex: 0-100(Math.random() * (myMax - myMin + 1) + myMin)
  5. 5When does should you write functions that start with a capital letter?When they are constructor functions.
    When there function is to create new objects.
  6. 6How do you write properties/values in a constructor function object?this.property = value;
    use this.
    equal sign.
    And semicolon
  7. 7How do you call a constructor function?With the new keyword in front.
    myCar = new Car();
  8. 8How do you assign new properties / values to an object?objName.newProp = value;
  9. 9What does the map method do?It iterates through an array. You can change the values and it stores them into a new array.
    Doesn't modify arrays though.
  10. 10What does the concat method do?merges the contents of two arrays into one
  11. 11join method. arrayName.join(" ");joins things of an array into a string.
    takes an delimeter(usually a space) to put between each array value.

Informações

Descrição
FlashCards sobre Javascript adv, criado por Alexander Lynds em 10-06-2017.
Criado por
Alexander Lynds
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?