BrainMass Quizzes Javscript Basics Quiz on basics of javascript programming language. 1 How do you write "Hello Brainmass" in an alert box? msgBox("Hello Brainmass"); alertBox("Hello Brainmass"); message("Hello Brainmass"); alert("Hello Brainmass"); msg("Hello Brainmass"); 2 How do you create a function in JavaScript? function = myFunction() function myFunction() function:myFunction() myFunction: function() 3 How do you write an IF statement in JavaScript to check that variable "i" has a value of 10? if (i == 10) if (i = 10) if i == 10 if i = 10 if (i equals 10) 4 How to write an IF statement for executing some code if "i" is NOT equal to 7? if (i <> 7) if (i =! 7) if (i != 7) if i <> 7 if (i neq 7) 5 What is the correct way to write a JavaScript array? var numbers = ("one", "two", "three") var numbers = "one" | "two" | "three" var numbers = "one", "two" "three" var numbers = ["one", "two", "three"] var numbers = {"one", "two", "three"} 6 How do you round the number 20.25, to the nearest integer Math.round(20.25) round(20.25) rnd(20.25) Math.rnd(20.25) int.round(20.25) 7 Which event occurs when the user clicks on an HTML element? mouseclick click onclick onchange clickmouse 8 How do you define a variable in javascript? myVar int; v myVar; variable myVar; vars myVar; var myVar; Submit Quiz