Dev4Hub
TutorialsRoadmapReviewNotesCode Editor
Sign inSign up
  • Python
  • HTML
  • CSS
  • JavaScript
  • SQL
Your progress0 / 4
search
school

JS Basics

  • 1JS Introduction
  • 2JS Variables
  • 3JS Functions
menu_book

JS DOM

  • 1DOM Introduction
Tutorialschevron_rightJavaScript Tutorialchevron_rightJS Variables

JS Variables

format_list_numberedLesson 2 of 4schedule1 min readview_agenda1 sectionauto_awesomeAI tutor ready
01

Declaring Variables

JavaScript variables can be declared with var, let, or const.

Example

let name = "John";
const age = 30;
var city = "London";
console.log(name, age, city);

Output

John 30 London
Try it Yourself »
arrow_back PreviousJS IntroductionNext arrow_forwardJS Functions

Dev4Hub

Learn coding with hands-on tutorials, examples and quizzes — covering Python, HTML, CSS, JavaScript, SQL and more.

Tutorials

  • Python
  • HTML
  • CSS
  • JavaScript
  • SQL

Tools

  • Code Editor
  • All Tutorials
© 2026 Dev4Hub. Inspired by the W3Schools learning model.