Quiz: Basic Syntax

Try this self-check quiz to test your knowledge!

What characters are used to denote a line ending in JavaScript?

Brackets Braces Semicolons Periods JavaScript uses semicolons to denote line endings.

What are two ways to add JavaScript to an HTML file?

Inline Packaged External Linked JavaScript can be added to HTML files using both inline and external methods.

What is the command used to declare a constant variable?

var let const The command const is used to declare a constant variable.

What two attributes are used to let the browser know it can continue processing HTML and downloading resources while a JavaScript file loads?

later defer noblock async The async and defer attributes allow the browser to continue rendering the page while external JavaScript files are loaded.

Which of these is a valid JavaScript comment?

<!-- comment goes here --> // comment goes here """comment goes here""" ::comment goes here A one-line comment in JavaScript begins with //.

Which operator gives you the remainder from dividing two operands?

++ % ** // The % operator denotes the remainder operation.

Which two operators are used to increment and decrement values by 1 in JavaScript?

++ -- &+ &- The ++ and -- operators are used to increment and decrement the value of a variable by 1.

Which command is used to define a "local" variable in JavaScript?

var const let local The let command is used to declare a local variable.

Visit Quiz Online

The quiz on this page has been removed from your PDF or ebook format. You may take the quiz by visiting this book online.

results matching ""

    No results matching ""