YouTip LogoYouTip

JavaScript Tutorial - First Steps

What is JavaScript?

JavaScript makes websites interactive. Every browser has a JS engine.

Hello World

console.log("Hello, World!");
document.getElementById("demo").innerHTML = "Changed!";

Variables

let name = "Alice";   // can reassign
const age = 25;       // cannot reassign
var old = "avoid";    // function-scoped

Summary

  • Use let and const, avoid var
  • console.log() for debugging
← JavaScript Variables and Data CSS3 Grid Layout β†’