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

Flashcards

JS Misc.

Cosmo Brown Inglês 66 flashcards

Flashcards do conjunto (66)

  1. 1API - DefinitionApplication Programming Interfaces
  2. 2Browser APIs - DefinitionBuilt into your browser. Able to expose data from surrounding computer environment
  3. 3Third Party APIs - DefinitionNot built into the browser, you generally have to find + download the code
  4. 4JS : Interpreted or Compiled?Interpreted
  5. 5Async Attribute- Scripts will download without blocking the render of the page
    - If multiple scripts, no guarantee that they will download in a certain order
  6. 6Defer Attribute- Scripts will run after the page is rendered
    - If multiple scripts, they will download in the order that they are listed (in the head)78
  7. 7Assignment Operators - Layman - ExamplesOperators that assign value to the left operand based on the value of right operand
    = , +=, -=, *=, /=
  8. 8Declaring a variableex: var myDog;
  9. 9Initializing a variable(after declaration)
    myDog = 'Scott';
  10. 10Types of Numbers: Floats or Floating Point NumbersDecimal Numbers
    ex: 2.792
  11. 11Dynamically Typed LanguageYou don't need to specify what data type a variable will contain
  12. 12Types of Numbers: DoublesSpecific type of floats that have more decimal numbers + more accuracy
  13. 13OperandsNumbers involved in sums
  14. 14Common Arithmetic Operators+
    -
    *
    /
  15. 15Increment/Decrement Operators++
    --
  16. 16Comparison Operators===
    !==
    <
    <=
  17. 17str.substring( a, b );- Returns the part of the string BETWEEN the indexes (or the end of the string)
    - A: the index of the starting character
    - B: OP, the index of the ending character
  18. 18str.slice( a, b)- Extracts a part of a string and returns it as a new string, without changing the original
    - A: OP, The start index of the 'cut'. If negative, treated as 'string.length + (-a)'
    - B: OP, The end index right before the 'cut'. This will not be included. If negative, treated as 'string.length + (-b)'
  19. 19str.repeat( a )- Returns a new string of the called-on string repeated 'a' times, concatenated together
    - A: Number of repetitions
  20. 20str.charAt( a )- Returns the character at the specified index position
    - A: Positon
  21. 21str.split( a, b )- Breaks the called-on string into an array of strings (separated by 'a'), and returns it as a new array
    -A: OP, Where the separations will occur . Using an empty string (ie: "") will cause problems.
    - B: OP, The limit. Limits the amount of separations that will occur.
  22. 22str.endsWith( a, b );- Returns true/false if the called-on string ends with 'a'
    - A: The string/chars to be matched
    - B: OP. If provided it is used as the length of string
  23. 23String Literals- Strings between quote marks
    - ex: 'This is my string literal'
  24. 24How to escape characters in JS- Use a backslash before the character
    - ' \ '
  25. 25str.charAt(*); Another way to write the above statementstr[ * ];
    Another way to write the above statement
  26. 26str.indexOf( a, b )Returns the index of the called-on string where 'a' first appears. If 'a' is not found, returns -1
    - A: String to match
    - B: OP, the index # to start the search from
  27. 27str.toLowerCase()- Returns a new string of the called-on string's characters, all lowercase
  28. 28str.toUpperCase()- Returns a new string of the called on string's characters, all uppercase
  29. 29str.includes( a, b )- Returns true/false if the called-on string contains 'a'
    - A: The string to check
    - B: OP, Position. The start index for the search
  30. 30An example of ' list-like objects 'Arrays
    (example of llo)
  31. 31if ( myVar ) { ... } - Values of ' myVar ' that will return false (not run the block)false
    undefined
    null
    0
    NaN
    ' ' (empty string)
  32. 32str.startsWith( a, b )Returns true if the called on string begins with 'a'
    A: The string to match
    B: OP, position from where to start the search
  33. 33str.endsWith( a, b )Returns true of the called on string ends with 'a'
    A: The string to match
    B: OP, Length. Used as the length of the called on string
  34. 34str.trim()Removes whitespace from both beginning and end of a string
    Return: A new string with no whitespace on either end
  35. 35arr.slice( a, b )Returns a new array populated from indexes 'a' to 'b' (b not included) of the called-on array
    A: Index Start. @
    B: OP, index end (not included). @
  36. 36arr.reverse()Reverses an array; first index becomes last index
    Return: The reversed array (no copy)
  37. 37For loop - Initializer - aka - Laymansaka: Counter Variable
    - Generally a variable set to a number
  38. 38For Loop - Exit ConditionDescribes when the loop should stop looping
  39. 39For Loop - Final Expression- Generally used to increment/decrement the iteration variable
  40. 40break; (in a loop) - ResultThe loop is exited and whatever code is directly after it will be run
  41. 41continue (in loop) - ResultSkip to the next iteration of a loop
  42. 42while loop - syntaxinitializer;
    while (exit condition) {
    //code
    final expression;
    }
  43. 43do/while - syntaxinitializer;
    do {
    //code
    final expression;
    } while (exit condition)
  44. 44arr.includes( a, b )- Returns true/false if the called-on array contains element 'a'
    A: The element to search for
    B: OP, Start Index. A negative value searches from the end.
  45. 45arr.sort( a )Sorts the called-on array (by string unicode points) and returns the modified array (no copy)
    A: OP, A function the defines the sort order
  46. 46arr.fill( a, b, c )Fills an array from a start index to an end index with a static value
    A: The value to fill the array
    B: OP, Start index
    C: OP, End index
    Return: The modified array
  47. 47arr.pop()Removes the last element of an array
    Return: The removed element, or undefined if the array is empty
  48. 48arr.push ( a...n )- Adds one or more elements to the end of an array
    A...N: The element(s) to add
    Return: The new length of the array
  49. 49arr.shift()- Removes the first element in the array
    - Return: The removed element. und if empty.
  50. 50arr.unshift( a...n )Adds one or more elements to the beginning of an array
    - A...N: The element(s) to be added
    - Return: The new length of the array
  51. 51Math.abs( a )- Returns the absolute value of a number
    - A: A number
  52. 52Math.pow( a, b )- Returns 'a' ^ 'b'
    - A: Base #
    -B: Exponent
  53. 53Function Invocation OperatorThe parentheses after a function
    - myFunction' () ' ;
  54. 54If intending to pass arguments into a named function that is assigned to an event handler, why do you need to put that named function into an anonymous function?If you add ' () ' to a function, it is immediately run, thus the lack of ' () ' when using EH's. But, to pass in arguments, you need ' () '. So, put the function into an anonymous function, so it is no longer in the immediate (global) scope, and thus not called immediately.
  55. 55Web Events - Part of the core JS Language?No. They are part of the JS APIs built into the browser
  56. 562 advantages of using addEventListener() over onclick1. You can use removeEventListener() to keep code clean
    2. You can add multiple event listeners to a single element event
  57. 57Event Handlers vs. Event Listeners-Often used interchangeably, but strictly speaking...
    - Handlers: blocks of code run in response to an event.
    Listeners: Listen for the even to happen.
  58. 58Event Handler Properties- Properties of the Event object
    - ex: onclick, onmouseover, onload, onfocus, etc
    - ex: btn.onclick = myFunction;
  59. 59DOM Level 2 Events- ex: addEventListener()
    - I believe these are sometimes called event listeners, though technically that term differs + is not specific to them.
  60. 60Event Capturing - Order- Outer most ancestor first, then moves down the decedents till it reaches the triggered element
  61. 61Event Bubbling - Order- Acts on the triggered element, then moves up the tree to the root element.
    - In modern browsers, all events are handled by the bubbling phase (not capturing)
  62. 62music.genre.blues; Convert to bracket notationmusic [ 'genre' ] [ 'blue' ];
    Convert to dot notation
  63. 63The 'this' keyword, at least as it relates to objectsRefers to the current object the code is being written inside.
  64. 64What is instantiation?Creating an instance of an object from a class
  65. 65A better way of access an objects' prototype than: obj.__proto__;Objects.getPrototypeOf( obj );
  66. 66Define ParsingConverting a string to a native object

Informações

Descrição
FlashCards sobre JS Misc., criado por Cosmo Brown em 04-10-2018.
Criado por
Cosmo Brown
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?