Quiz: Data Types and Structures

Please enjoy this self-check quiz to review some of the concepts from this section.

Does JavaScript require us to declare the Data Type of a variable?

yes no JavaScript is known as a "dynamic" language, and it does not require us to declare the Data Type of a variable when we create it.

What Data Type(s) are assigned to numeric values?

Decimal Integer Float Number All numeric values in JavaScript are Number type values.

What command allows you to break apart a String into an Array based on a chosen character?

break() join() split() separate() The split() command allows us to break apart a String into an Array.

null and undefined mean the same thing.

True False null is typically used to indicate missing data, while undefined means that the value has not been initialized.

What are the values possible for a Boolean Data Type?

true false maybe xor "True" and "false" are the only values a Boolean Data Type may have.

The process of marking certain characters (such as apostrophes) so they work within Strings is:

enhancing escaping converting encoding We "escape" certain characters to make them display properly in a String.

Objects in JavaScript can be thought of as collections of related what?

methods functions attributes data An Object is a collection of related attributes.

Name the index of the item 'apple' in this Array: ['apple', 'orange', 'banana']

0 1 2 The item 'apple' is at the index 0 in the Array.

What command is used to remove the last item in an Array?

pop() shift() join() splice() The pop() command is used to remove the last item in an Array.

What command is used to remove the first item in an Array?

pop() shift() join() splice() The shift() command is used to remove the first item in an Array.

What command is used to remove a group of items from within an Array?

pop() shift() join() splice() The splice() command is used to remove a group of items within an Array.

What programming languages support JSON as a data interchange format?

JavaScript Python Ruby PHP Almost all modern programming languages support JSON as a data interchange format.

What command is used to create a String from the items in an Array?

pop() shift() join() splice() The join() command is used to create a String from the items in an Array.

The proper format for an expression within a Template Literal is:

[expression] $expression ${expression} Template Literals use the ${expression} format for expressions.

Given let key="foo"; and let myObject = {foo: 42};, which of the following are true?

myObject.foo == 42 myObject(foo) == 42 myObject[key] == 42 myObject['foo'] == 42 The value may be referenced via dot notation or a key.

If let a = {}; and let b = [];, which statement is true?

a is a String and b is an Object. a is an Object and b is an Array. a is an Array and b is an Object. a is Undefined and b is also Undefined. a is an empty Object and b is an empty Array.

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 ""