Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Nodeschool.io JavaScripting
- ## Introduction
- * No notes were taken
- ## Variables
- * No notes were taken
- ## Strings
- * Looks like convention in JavaScript is to use single quotes.
- ## String Length
- * No notes were taken
- ## Revising Strings
- * 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.
- ## Numbers
- * No notes were taken
- ## Rounding Numbers
- * To round numbers in JavaScript we use the `Math` object along with the `.round()` method and pass it in the float we want rounded.
- ## Number to String
- * We use the `.toString()` method to convert a number to a string.
- ## If Statement
- * No notes were taken
- ## For Loop
- * No notes were taken
- ## Arrays
- * No notes were taken
- ## Array Filtering
- * We use the `.filter()` method to filter an array based on a condition.
- ```js
- var filtered = numbers.filter(function(num) {
- return num % 2 === 0;
- });
- ```
- ## Accessing Array Values
- * No notes were taken
- ## Looping Through Arrays
- * No notes were taken
- ## Objects
- * No notes were taken
- ## Object Properties
- * No notes were taken
- ## Functions
- * No notes were taken
- ## Function Arguments
- * No notes were taken
- ## Scope
- * Scope is the set of variables, objects, and functions you have access to.
- * JavaScript has two scopes: global and local.
- * A variable that is declared outside a function definition is a global variable, and its value is accessible and modifiable throughout your program.
- * 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.
- * Functions defined inside other functions, known as nested functions, have access to their parent function's scope.
- * IIFE, Immediately Invoked Function Expression, is a common pattern for creating local scopes.
- ```js
- (function() {
- })();
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement