šŸ’»

JavaScript Basics and Syntax Introduction

Jun 24, 2024

JavaScript for Beginners: FreeCodeCamp.org Free Course šŸ’»

Introduction

  • Course taught by Beau Carnes from FreeCodeCamp.org
  • Targeted at beginners or as a review of basic JavaScript syntax
  • It is a standalone course but complements the JavaScript curriculum from FreeCodeCamp.org
  • Importance of practicing by creating your own projects

JavaScript Installation

  • No installation needed: all web browsers can run JavaScript
  • Tools to follow the course:
    • Code editors: Sublime Text, Visual Studio Code, Atom
    • freeCodeCamp.org with a built-in editor
    • CodePen.io
    • Scrimba.com

Comments in JavaScript

  • Include notes in the code that will be ignored by JavaScript
  • // for single-line comments
  • /* ... */ for multi-line comments

Data Types and Variables

  • Data is meaningful to the computer
  • Seven data types in JavaScript: undefined, null, boolean, string, symbol, number, object
  • Variable declarants: var, let, const
  • let: variables within the scope where they were declared
  • const: variables that should not change

Variable Assignment

  • Declare (e.g., var a;) and assign (a = 7;)
  • console.log() to see values in the console

Mathematical Operators

  • Addition (+), subtraction (-), multiplication (*), division (/)
  • Increment (++), decrement (--)
  • Decimal numbers (floats)
  • Remainder of a division: %
  • Compound operators (+=, -=, *=, /=)

Strings and Concatenation

  • String declaration: var myName =