Script Valley
JavaScript Tutorial for Beginners to Advanced
JavaScript Basics: Variables, Data Types, and Operators/Assessment

Practice & Assessment

Test your understanding of JavaScript Basics: Variables, Data Types, and Operators

Multiple Choice Questions

5
1

Which keyword should you use by default for declaring variables in modern JavaScript?

2

What does the typeof operator return for an array?

3

What is the result of '5' + 3 in JavaScript?

4

What does the nullish coalescing operator (??) do?

5

What is the key difference between null and undefined in JavaScript?

Coding Challenges

1
1

Shopping Cart Price Calculator

Create a script that declares variables for three product names, their prices, and quantities. Calculate the subtotal for each product, the overall total, a 10% discount if the total exceeds 100, and the final price after the discount. Display all values using console.log with descriptive labels.

Easy
GeeksForGeeks

Mini Project

1

Interactive Unit Converter

Build an HTML page with an input field and buttons. The user types a number and can click buttons to convert it between kilometres and miles, Celsius and Fahrenheit, and kilograms and pounds. Display each converted result on the page using innerHTML. Use const and let appropriately, apply the correct arithmetic operators for each formula, and format all outputs to two decimal places using toFixed(2).

Easy