Skip to content

Instantly share code, notes, and snippets.

@davidystephenson
Created September 13, 2025 16:50
Show Gist options
  • Save davidystephenson/64ae25f99159f4d92de256fb26da7e83 to your computer and use it in GitHub Desktop.
Save davidystephenson/64ae25f99159f4d92de256fb26da7e83 to your computer and use it in GitHub Desktop.
/*
// 1. Declare a variable called `personName` and assign your name to it.
var personName = 'David Y. Stephenson'
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. Create a variable `favoriteFruits` and assign it an array of strings representing your favorite fruits.
var favoriteFruits = ['olives', 'apples', 'grapes']
console.log(favoriteFruits)
// 5. 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 = 8
var isSingleDigit = num < 10
console.log(isSingleDigit)
// 6. Create a variable `myNullValue` and assign it a null value.
var myNullValue = null
console.log(myNullValue)
// 8. Create a variable `undefinedVariable` and without assigning any value to it, display its value.
var undefinedVariable
console.log(undefinedVariable)
// 9. 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)
*/
// 10. Create a variable `mixedArray` that contains a mix of data types, including numbers, strings, and booleans.
var mixedArray = [42, 'hello world', true]
console.log(mixedArray)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment