%%js
//defining all variables
let studentName = "Lara Banjac"
let studentAge = "14"
let isStudent = true
let favouriteSong = "FE!N (pls don't bully me for this, I am actually not an NPC😭😭)"
let songArtist = "Travis Scott"
let trueStudent = "I am a student at DNHS."
let falseStudent = "I am not a student at DNHS."
// Code funtion that creates a sentence out of the variables
function studentProfile() {
//Btw I didn't know what f strings look like in js, so I just did it like this
console.log("My name is ",studentName, "and I am",studentAge)
}
//Coding a function that determines wether or not the person is a student at DNHS, based off of the variable isStudent
function isThisAStudent(){
if (isStudent === true){
console.log(trueStudent)
}else{
console.log(falseStudent)
}
}
//Coding function that tells the user what song is playing
function playFavouriteSong(){
console.log("Now playing",favouriteSong,"by",songArtist)
}
//Call all functions (or sth like that, Idk how else to say it lol)
studentProfile()
isThisAStudent()
playFavouriteSong()
<IPython.core.display.Javascript object>