Created
April 5, 2025 16:40
-
-
Save davidystephenson/3a64805f509f92735e8cb13a8a705b41 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. Declare a variable called `personName` and assign your name to it. | |
var personName = 'david' | |
console.log(personName) | |
// 2. Create a variable `age` and assign your age to it. | |
var age = 34 | |
console.log(age) | |
// 3. Create a variable `isStudent` and assign it a boolean value. | |
var isStudent = false | |
console.log(isStudent) | |
// 4. Declare a variable `isSingleDigit` and assign it a boolean value based on the value of the given number, `num` if its less than 10 | |
var num = 5 | |
var isSingleDigit = num < 10 | |
console.log(isSingleDigit) | |
// 5. Create a variable `myNullValue` and assign it a null value. | |
var myNullValue = null | |
console.log(myNullValue) | |
// 6. Create a variable `undefinedVariable` and without assigning any value to it, display its value. | |
var undefinedVariable | |
console.log(undefinedVariable) | |
// 7. Declare a variable `yearsInCollege` and assign it a numeric value. Then, create a new variable `isInCollege` and assign it a boolean value based on whether `yearsInCollege` is greater than zero. | |
var yearsInCollege = 4 | |
var isInCollege = yearsInCollege > 0 | |
console.log(isInCollege) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment