Skip to content

Latest commit

 

History

History
50 lines (43 loc) · 933 Bytes

File metadata and controls

50 lines (43 loc) · 933 Bytes

JavaScript Basics

  • Basics of the language

    • Variables
    • Conditionals
    • Iteration
    • Operators
    • Equality / Comparison
    • Function Basics
      • Arguments / Parameters
      • return
  • Ternary / Short Circuit

function buttonText(isLoggedIn) {
  if (isLoggedIn) {
    return 'Logout';
  } else {
    return 'Login';
  }
}


function buttonText(isLoggedIn) {
  return isLoggedIn ? 'Logout' : 'Login';
}

function demo() {
  const result1 = true && 'Yep';
  console.log(result1); // Yep
  const result2 = false && 'Nope';
  console.log(result2); // false
}
  • Scope
    • Types of Scope
      • Global Scope
      • Function Scope
      • Block Scope
      • Module Scope
    • Hoisting
  • More Advanced Function Concepts
    • First Class Functions
      • Functions can be variables in JS
    • Higher Order Functions
      • A function that accepts a function as an argument
      • A function that returns a function
        • Closures