challenge two complete

pull/183/head
matt vile 4 years ago
parent bcd211b679
commit b1c3ce33ce

@ -29,3 +29,33 @@ console.log(challenge.match("a"))
let thirty = "30"
console.log(thirty.concat(' Days of', ' JavaScript'))
console.log(challenge.repeat(2))
// challenge two
console.log("The quote 'There is no exercise better for the heart than reaching down and lifting people up.' by John Holmes teaches us to help one another.")
console.log("Love is not patronizing and charity isn't about pity, it is about love. Charity and love are the same -- with charity you give love, so don't just give money but reach out your hand instead.")
console.log(typeof '10')
console.log(typeof 10)
console.log(typeof parseInt('10'))
console.log(parseFloat('9.8'))
console.log(Number('9.8'))
console.log(parseInt('9.8') + 1)
console.log(Number('9.8'))
let smolArray = ["jargon", "python"]
smolArray.forEach(hasOnFunction)
function hasOnFunction(value, index, array) {
console.log(`does ${value} include on`)
console.log(value.includes("on"))
}
let sentence = "I hope this course is not full of jargon."
console.log(sentence.includes("jargon"))
let randomNum0_100 = parseInt(Math.random() * 101)
console.log(randomNum0_100)
let randomNum50_100 = Math.floor(Math.random() * 51) + 50
console.log(randomNum50_100)
let randomNum0_250 = Math.round(Math.random() * 251)
console.log(randomNum0_250)
console.log("JavaScript".charAt(parseInt(Math.random() * 11)))
let escapeNums = "1 1 1 1 1 \n2 1 2 4 8 \n3 1 3 9 27 \n4 1 4 16 64 \n5 1 5 25 125"
console.log(escapeNums)
console.log(sillySentence.substr(31, 23))

Loading…
Cancel
Save