Challenge: Define the Variable
Task
- Define a variable named
myVar
and assign the value15
to it. - Print the variable
myVar
to the console.
___ ___ = ___; console.log(___);
Thanks for your feedback!
myVar
and assign the value 15
to it.myVar
to the console.123___ ___ = ___; console.log(___);
let
keyword to declare a variable.=
).console.log()
function to print the variable's value to the console.123let myVar = 15; console.log(myVar);
Thanks for your feedback!
Discover the fundamentals of JavaScript, including its purpose and syntax. Learn how to work with the console for output and use comments to organize and document your code. These foundational skills will prepare you for a deeper exploration of JavaScript's capabilities.
Explore the building blocks of JavaScript by distinguishing between literals and variables. Understand the core data types, including `null` and arrays, and learn how to manipulate them using array methods.
Learn how to manipulate JavaScript's data types through essential operations. Master assignment, mathematical operations, incrementing and decrementing, comparisons, logical operations, and string concatenation.
Discover how to control the flow of your programs with conditional statements. Master `if`, `else`, and `else if` to instruct JavaScript on making decisions and executing code based on different conditions.
Streamline your code by mastering JavaScript's looping structures. Explore `while`, `do while`, and `for` loops, and learn how to control their behavior using `break` and `continue`. Unlock the power of loops to perform repetitive tasks efficiently.
Discover the power of functions in JavaScript. Learn how to define functions, work with arguments, and use the `return` statement to create reusable and efficient code. Mastering functions will enhance your ability to write clean and modular programs.