Advertisement
Guest User

Untitled

a guest
May 4th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. # Nodeschool.io JavaScripting
  2.  
  3. ## Introduction
  4.  
  5. * No notes were taken
  6.  
  7. ## Variables
  8.  
  9. * No notes were taken
  10.  
  11. ## Strings
  12.  
  13. * Looks like convention in JavaScript is to use single quotes.
  14.  
  15. ## String Length
  16.  
  17. * No notes were taken
  18.  
  19. ## Revising Strings
  20.  
  21. * JavaScript has a `.replace()` method that takes two arguments. The first argument is an existing substring and the second is the string that will replace it.
  22.  
  23. ## Numbers
  24.  
  25. * No notes were taken
  26.  
  27. ## Rounding Numbers
  28.  
  29. * To round numbers in JavaScript we use the `Math` object along with the `.round()` method and pass it in the float we want rounded.
  30.  
  31. ## Number to String
  32.  
  33. * We use the `.toString()` method to convert a number to a string.
  34.  
  35. ## If Statement
  36.  
  37. * No notes were taken
  38.  
  39. ## For Loop
  40.  
  41. * No notes were taken
  42.  
  43. ## Arrays
  44.  
  45. * No notes were taken
  46.  
  47. ## Array Filtering
  48.  
  49. * We use the `.filter()` method to filter an array based on a condition.
  50. ```js
  51. var filtered = numbers.filter(function(num) {
  52. return num % 2 === 0;
  53. });
  54. ```
  55.  
  56. ## Accessing Array Values
  57.  
  58. * No notes were taken
  59.  
  60. ## Looping Through Arrays
  61.  
  62. * No notes were taken
  63.  
  64. ## Objects
  65.  
  66. * No notes were taken
  67.  
  68. ## Object Properties
  69.  
  70. * No notes were taken
  71.  
  72. ## Functions
  73.  
  74. * No notes were taken
  75.  
  76. ## Function Arguments
  77.  
  78. * No notes were taken
  79.  
  80. ## Scope
  81.  
  82. * Scope is the set of variables, objects, and functions you have access to.
  83. * JavaScript has two scopes: global and local.
  84. * A variable that is declared outside a function definition is a global variable, and its value is accessible and modifiable throughout your program.
  85. * A variable that is declared inside a function definition is local. It is created and destroyed everytime the function is executed, and it cannot be accessed by any code outside the function.
  86. * Functions defined inside other functions, known as nested functions, have access to their parent function's scope.
  87. * IIFE, Immediately Invoked Function Expression, is a common pattern for creating local scopes.
  88. ```js
  89. (function() {
  90. })();
  91. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement