


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
JAVASCRIPT Exam Questions and Answers Latest Graded A+
Typology: Exams
1 / 4
This page cannot be seen from the preview
Don't miss anything!



What is JavaScript? - ✔✔A computer language used predominantly by browsers What tools do you need to create web applications in JavaScript? - ✔✔A text editor, A Browser Where do you put the JavaScript so that it will execute properly in your documents? - ✔✔Linked as an external file with a .js extension. , at the end of the body section of the HTML document, In the head section of the HTML document, In a "script block" within the HTML The alert() function is a method to give user feedback. What does the command do when executed? - ✔✔Pops up a dialog box in the browser with text information and an "OK" button. How would you format a comment in JavaScript to leave author notes or assist in troubleshooting your code? - ✔✔/* commented text*/ , // commented text data types recognized in JavaScript - ✔✔Text, Numbers, Booleans What is a variable? - ✔✔Temporary data storage that can be altered, or varied. A variable declaration is the creation of a new storage area in memory. It is achieved using the var keyword and - ✔✔a name. Once declared, a variable gets its type and value through the process of - ✔✔declaration. What is an array? - ✔✔A variable that can hold more than one value. Which of the following is NOT a comparison operator? < >= = ==
Operators have an order of precedence. Arithmetic operators have a higher priority than comparison operators. - ✔✔True Assignment operators can store the result of a comparison operation. - ✔✔True Comparisons can be made to control program flow with what type of JavaScript statement(s)? - ✔✔Conditionals The result of the following code block will be: var roomTemprature = 30; if (roomTemperature > 30) { roomTemperature = roomTemperature - 10; alert("Air conditioning switched to cool"); } else {alert("Air conditioning off");} - ✔✔An error will appear in the JavaScript console Logical operators can add complexity to a comparison with AND, OR, and NOT. Which of the following is true? true && true || true ; returns false true && true || false ; returns true true && false; returns false false || true || !true && false; returns true false && true && true ||false; returns true - ✔✔true && true || false ; returns true true && false; returns false false || true || !true && false; returns true You can have an if statement contained inside of an if statement. - ✔✔True There is an alternative to the if...else conditional statement in JavaScript. This is the - ✔✔switch statement There are several types of looping structures in Javascript.These include (select all that apply)
Undefined variables or functions - ✔✔All are correct A great way to check for errors is by using the following programming structure in JavaScript - ✔✔try...catch What is a common way to debug your code? (select all that apply) Setting Breakpoints Adding "watches" on variables Outputting values to the console with console.log commenting out code Using "debug mode" in Microsoft Visual Studio Code. - ✔✔Setting Breakpoints Adding "watches" on variables Outputting values to the console with console.log commenting out code Murphy's Law states that anything that can go wrong - ✔✔will go wrong! Some errors are not necessarily bugs in your code, but in fact exceptions to the normal circumstances that cause your code to fail. - ✔✔True