GoConqr has a new look! Let us know what you think.

Flashcards

Javascript adv

Alexander Lynds English 11 cards

Cards in this deck (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.

Information

Description
Flashcards on Javascript adv, created by Alexander Lynds on 10/06/2017.
Created by
Alexander Lynds
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?