Deck 8: Manipulating Data in Strings and Arrays

Full screen (f)
exit full mode
Question
Regular expression patterns in JavaScript must begin and end with backward slashes.
Use Space or
up arrow
down arrow
to flip the card.
Question
Characters contained in a set of parentheses within a regular expression are referred to as a subexpression or ____.

A) subpattern
B) substring
C) subrule
D) subset
Question
The JavaScript String class includes the ____ method, which creates a new string by combining strings that are passed as arguments.

A) strcpy()
B) strcat()
C) strpst()
D) concat()
Question
The fromCharCode()method is called a ____ method because it is not used as a method of any string objects (which can be literal strings or variables)in your scripts.

A) local
B) static
C) global
D) dynamic
Question
The ____ method converts a text string to uppercase.

A) toUpperCase()
B) toMaxCase()
C) toHigherCase()
D) toTitleCase()
Question
The length property counts escape sequences such as \n as two characters.
Question
The replace()method is case sensitive.
Question
The ____ method returns the position number in a string of the first instance of the first character in the pattern argument.

A) charAt( pattern )
B) indexOf( pattern )
C) slice( pattern )
D) search( pattern )
Question
You use ____ classes in regular expressions to treat multiple characters as a single item.

A) expression
B) character
C) pattern
D) metarule
Question
To manipulate arrays in your scripts, you use the methods and length property of the ____ class.

A) Array
B) String
C) Matrix
D) Vector
Question
To convert a JSON string to a JavaScript object, you use the parse()method of the JSON object.
Question
A pattern that matches the beginning or end of a line is called a(n)____.

A) tail
B) metacharacter
C) metastring
D) anchor
Question
To allow a string to contain an alternate set of substrings, you separate the strings in a regular expression pattern with the ____ metacharacter.

A) $
B) /
C) |
D) &
Question
Regular expression patterns consist of literal characters and ____.

A) metacharacters
B) metadata
C) metabytes
D) supercharacters
Question
The String class ____ property returns the number of characters in a string.

A) elements
B) size
C) length
D) maxIndex
Question
You can use a text string as a literal value or assign it to a variable.
Question
The ____ method of the String class returns the position number in a string of the first character in the argument.

A) search()
B) charAt()
C) indexOf()
D) substring()
Question
The ____ object contains methods and properties for working with regular expressions in JavaScript.

A) Expression
B) RegExp
C) StrExp
D) StringExp
Question
The ____ method constructs a text string from Unicode character codes that are passed as arguments.

A) fromCharCode()
B) fromUniCode()
C) fromLangCode()
D) fromStrCode()
Question
The ____ method converts a text string to lowercase.

A) toMinCase()
B) lowerCase()
C) toLowerCase()
D) toUpperCase()
Question
All literal strings and string variables in JavaScript are represented by a(n)____________________ class, which contains methods for manipulating text strings.
Question
Match between columns
Compares strings according to the particular sort order of a language or country
string
Compares strings according to the particular sort order of a language or country
parse()
Compares strings according to the particular sort order of a language or country
|
Compares strings according to the particular sort order of a language or country
Unicode
Compares strings according to the particular sort order of a language or country
pop()
Compares strings according to the particular sort order of a language or country
join()
Compares strings according to the particular sort order of a language or country
localeCompare()method
Compares strings according to the particular sort order of a language or country
metacharacter
Compares strings according to the particular sort order of a language or country
quantifier
Compares strings according to the particular sort order of a language or country
push()
Text contained within double or single quotation marks
string
Text contained within double or single quotation marks
parse()
Text contained within double or single quotation marks
|
Text contained within double or single quotation marks
Unicode
Text contained within double or single quotation marks
pop()
Text contained within double or single quotation marks
join()
Text contained within double or single quotation marks
localeCompare()method
Text contained within double or single quotation marks
metacharacter
Text contained within double or single quotation marks
quantifier
Text contained within double or single quotation marks
push()
A standardized set of characters from many of the world's languages
string
A standardized set of characters from many of the world's languages
parse()
A standardized set of characters from many of the world's languages
|
A standardized set of characters from many of the world's languages
Unicode
A standardized set of characters from many of the world's languages
pop()
A standardized set of characters from many of the world's languages
join()
A standardized set of characters from many of the world's languages
localeCompare()method
A standardized set of characters from many of the world's languages
metacharacter
A standardized set of characters from many of the world's languages
quantifier
A standardized set of characters from many of the world's languages
push()
Metacharacter that specifies the quantity of a match
string
Metacharacter that specifies the quantity of a match
parse()
Metacharacter that specifies the quantity of a match
|
Metacharacter that specifies the quantity of a match
Unicode
Metacharacter that specifies the quantity of a match
pop()
Metacharacter that specifies the quantity of a match
join()
Metacharacter that specifies the quantity of a match
localeCompare()method
Metacharacter that specifies the quantity of a match
metacharacter
Metacharacter that specifies the quantity of a match
quantifier
Metacharacter that specifies the quantity of a match
push()
Special character that defines pattern matching rules in a regular expression
string
Special character that defines pattern matching rules in a regular expression
parse()
Special character that defines pattern matching rules in a regular expression
|
Special character that defines pattern matching rules in a regular expression
Unicode
Special character that defines pattern matching rules in a regular expression
pop()
Special character that defines pattern matching rules in a regular expression
join()
Special character that defines pattern matching rules in a regular expression
localeCompare()method
Special character that defines pattern matching rules in a regular expression
metacharacter
Special character that defines pattern matching rules in a regular expression
quantifier
Special character that defines pattern matching rules in a regular expression
push()
Separates alternate sets of substrings in a regular expression
string
Separates alternate sets of substrings in a regular expression
parse()
Separates alternate sets of substrings in a regular expression
|
Separates alternate sets of substrings in a regular expression
Unicode
Separates alternate sets of substrings in a regular expression
pop()
Separates alternate sets of substrings in a regular expression
join()
Separates alternate sets of substrings in a regular expression
localeCompare()method
Separates alternate sets of substrings in a regular expression
metacharacter
Separates alternate sets of substrings in a regular expression
quantifier
Separates alternate sets of substrings in a regular expression
push()
Adds one or more elements to the end of an array
string
Adds one or more elements to the end of an array
parse()
Adds one or more elements to the end of an array
|
Adds one or more elements to the end of an array
Unicode
Adds one or more elements to the end of an array
pop()
Adds one or more elements to the end of an array
join()
Adds one or more elements to the end of an array
localeCompare()method
Adds one or more elements to the end of an array
metacharacter
Adds one or more elements to the end of an array
quantifier
Adds one or more elements to the end of an array
push()
Removes the last element from the end of an array
string
Removes the last element from the end of an array
parse()
Removes the last element from the end of an array
|
Removes the last element from the end of an array
Unicode
Removes the last element from the end of an array
pop()
Removes the last element from the end of an array
join()
Removes the last element from the end of an array
localeCompare()method
Removes the last element from the end of an array
metacharacter
Removes the last element from the end of an array
quantifier
Removes the last element from the end of an array
push()
Converts a JSON string value to an object
string
Converts a JSON string value to an object
parse()
Converts a JSON string value to an object
|
Converts a JSON string value to an object
Unicode
Converts a JSON string value to an object
pop()
Converts a JSON string value to an object
join()
Converts a JSON string value to an object
localeCompare()method
Converts a JSON string value to an object
metacharacter
Converts a JSON string value to an object
quantifier
Converts a JSON string value to an object
push()
Combines array elements into a string
string
Combines array elements into a string
parse()
Combines array elements into a string
|
Combines array elements into a string
Unicode
Combines array elements into a string
pop()
Combines array elements into a string
join()
Combines array elements into a string
localeCompare()method
Combines array elements into a string
metacharacter
Combines array elements into a string
quantifier
Combines array elements into a string
push()
Question
The ____ method adds one or more elements to the end of an array.

A) pop()
B) push()
C) shift()
D) unshift()
Question
To sort elements of an array alphabetically, you use the ____ method.

A) arrange()
B) order()
C) list()
D) sort()
Question
To convert a JavaScript object to a JSON string, you use the ____ method.

A) convertToString()
B)json()
C)parse()
D)stringify()
Question
List and describe three metacharacters that you can use with JavaScript regular expressions.
Question
What are the toString()and toLocaleString()methods used for, and what is the difference between them?
Question
The ____________________ method of the String class creates a new string with the first instance of a specified pattern replaced with the value of the text argument.
Question
When applied to text strings, the term ____________________ refers to the act of extracting characters or substrings from a larger string.
Question
The ____ method removes and returns the first element from the beginning of an array.

A) split()
B) unshift()
C) shift()
D) slice()
Question
You use the ____ method of the String class to split a string into an indexed array.

A) toArray()
B) slice()
C) split()
D) shift()
Question
Provide two different regular expressions that return true only when tested against a string consisting of exactly 5 characters.
Question
Explain how to change the case of a variable's valueusing the toLowerCase() or toUpperCase()method.
Question
Explain the difference between the shift()and unshift()methods of the Array object.
Question
_________________________ are patterns that are used for matching and manipulating strings according to specified rules.
Question
__________ is a data format that represents a JavaScript object as a string.
Question
What is the primary difference between the search()method and the indexOf()method?
Question
How can you combine text strings with JavaScript?
Question
How can you match any metacharacters as literal values in a regular expression?
Question
What is the difference between the slice()and substring()methods?
Question
How do you create a character class with JavaScript?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/41
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 8: Manipulating Data in Strings and Arrays
1
Regular expression patterns in JavaScript must begin and end with backward slashes.
False
2
Characters contained in a set of parentheses within a regular expression are referred to as a subexpression or ____.

A) subpattern
B) substring
C) subrule
D) subset
A
3
The JavaScript String class includes the ____ method, which creates a new string by combining strings that are passed as arguments.

A) strcpy()
B) strcat()
C) strpst()
D) concat()
D
4
The fromCharCode()method is called a ____ method because it is not used as a method of any string objects (which can be literal strings or variables)in your scripts.

A) local
B) static
C) global
D) dynamic
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
5
The ____ method converts a text string to uppercase.

A) toUpperCase()
B) toMaxCase()
C) toHigherCase()
D) toTitleCase()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
6
The length property counts escape sequences such as \n as two characters.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
7
The replace()method is case sensitive.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
8
The ____ method returns the position number in a string of the first instance of the first character in the pattern argument.

A) charAt( pattern )
B) indexOf( pattern )
C) slice( pattern )
D) search( pattern )
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
9
You use ____ classes in regular expressions to treat multiple characters as a single item.

A) expression
B) character
C) pattern
D) metarule
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
10
To manipulate arrays in your scripts, you use the methods and length property of the ____ class.

A) Array
B) String
C) Matrix
D) Vector
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
11
To convert a JSON string to a JavaScript object, you use the parse()method of the JSON object.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
12
A pattern that matches the beginning or end of a line is called a(n)____.

A) tail
B) metacharacter
C) metastring
D) anchor
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
13
To allow a string to contain an alternate set of substrings, you separate the strings in a regular expression pattern with the ____ metacharacter.

A) $
B) /
C) |
D) &
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
14
Regular expression patterns consist of literal characters and ____.

A) metacharacters
B) metadata
C) metabytes
D) supercharacters
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
15
The String class ____ property returns the number of characters in a string.

A) elements
B) size
C) length
D) maxIndex
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
16
You can use a text string as a literal value or assign it to a variable.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
17
The ____ method of the String class returns the position number in a string of the first character in the argument.

A) search()
B) charAt()
C) indexOf()
D) substring()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
18
The ____ object contains methods and properties for working with regular expressions in JavaScript.

A) Expression
B) RegExp
C) StrExp
D) StringExp
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
19
The ____ method constructs a text string from Unicode character codes that are passed as arguments.

A) fromCharCode()
B) fromUniCode()
C) fromLangCode()
D) fromStrCode()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
20
The ____ method converts a text string to lowercase.

A) toMinCase()
B) lowerCase()
C) toLowerCase()
D) toUpperCase()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
21
All literal strings and string variables in JavaScript are represented by a(n)____________________ class, which contains methods for manipulating text strings.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
22
Match between columns
Compares strings according to the particular sort order of a language or country
string
Compares strings according to the particular sort order of a language or country
parse()
Compares strings according to the particular sort order of a language or country
|
Compares strings according to the particular sort order of a language or country
Unicode
Compares strings according to the particular sort order of a language or country
pop()
Compares strings according to the particular sort order of a language or country
join()
Compares strings according to the particular sort order of a language or country
localeCompare()method
Compares strings according to the particular sort order of a language or country
metacharacter
Compares strings according to the particular sort order of a language or country
quantifier
Compares strings according to the particular sort order of a language or country
push()
Text contained within double or single quotation marks
string
Text contained within double or single quotation marks
parse()
Text contained within double or single quotation marks
|
Text contained within double or single quotation marks
Unicode
Text contained within double or single quotation marks
pop()
Text contained within double or single quotation marks
join()
Text contained within double or single quotation marks
localeCompare()method
Text contained within double or single quotation marks
metacharacter
Text contained within double or single quotation marks
quantifier
Text contained within double or single quotation marks
push()
A standardized set of characters from many of the world's languages
string
A standardized set of characters from many of the world's languages
parse()
A standardized set of characters from many of the world's languages
|
A standardized set of characters from many of the world's languages
Unicode
A standardized set of characters from many of the world's languages
pop()
A standardized set of characters from many of the world's languages
join()
A standardized set of characters from many of the world's languages
localeCompare()method
A standardized set of characters from many of the world's languages
metacharacter
A standardized set of characters from many of the world's languages
quantifier
A standardized set of characters from many of the world's languages
push()
Metacharacter that specifies the quantity of a match
string
Metacharacter that specifies the quantity of a match
parse()
Metacharacter that specifies the quantity of a match
|
Metacharacter that specifies the quantity of a match
Unicode
Metacharacter that specifies the quantity of a match
pop()
Metacharacter that specifies the quantity of a match
join()
Metacharacter that specifies the quantity of a match
localeCompare()method
Metacharacter that specifies the quantity of a match
metacharacter
Metacharacter that specifies the quantity of a match
quantifier
Metacharacter that specifies the quantity of a match
push()
Special character that defines pattern matching rules in a regular expression
string
Special character that defines pattern matching rules in a regular expression
parse()
Special character that defines pattern matching rules in a regular expression
|
Special character that defines pattern matching rules in a regular expression
Unicode
Special character that defines pattern matching rules in a regular expression
pop()
Special character that defines pattern matching rules in a regular expression
join()
Special character that defines pattern matching rules in a regular expression
localeCompare()method
Special character that defines pattern matching rules in a regular expression
metacharacter
Special character that defines pattern matching rules in a regular expression
quantifier
Special character that defines pattern matching rules in a regular expression
push()
Separates alternate sets of substrings in a regular expression
string
Separates alternate sets of substrings in a regular expression
parse()
Separates alternate sets of substrings in a regular expression
|
Separates alternate sets of substrings in a regular expression
Unicode
Separates alternate sets of substrings in a regular expression
pop()
Separates alternate sets of substrings in a regular expression
join()
Separates alternate sets of substrings in a regular expression
localeCompare()method
Separates alternate sets of substrings in a regular expression
metacharacter
Separates alternate sets of substrings in a regular expression
quantifier
Separates alternate sets of substrings in a regular expression
push()
Adds one or more elements to the end of an array
string
Adds one or more elements to the end of an array
parse()
Adds one or more elements to the end of an array
|
Adds one or more elements to the end of an array
Unicode
Adds one or more elements to the end of an array
pop()
Adds one or more elements to the end of an array
join()
Adds one or more elements to the end of an array
localeCompare()method
Adds one or more elements to the end of an array
metacharacter
Adds one or more elements to the end of an array
quantifier
Adds one or more elements to the end of an array
push()
Removes the last element from the end of an array
string
Removes the last element from the end of an array
parse()
Removes the last element from the end of an array
|
Removes the last element from the end of an array
Unicode
Removes the last element from the end of an array
pop()
Removes the last element from the end of an array
join()
Removes the last element from the end of an array
localeCompare()method
Removes the last element from the end of an array
metacharacter
Removes the last element from the end of an array
quantifier
Removes the last element from the end of an array
push()
Converts a JSON string value to an object
string
Converts a JSON string value to an object
parse()
Converts a JSON string value to an object
|
Converts a JSON string value to an object
Unicode
Converts a JSON string value to an object
pop()
Converts a JSON string value to an object
join()
Converts a JSON string value to an object
localeCompare()method
Converts a JSON string value to an object
metacharacter
Converts a JSON string value to an object
quantifier
Converts a JSON string value to an object
push()
Combines array elements into a string
string
Combines array elements into a string
parse()
Combines array elements into a string
|
Combines array elements into a string
Unicode
Combines array elements into a string
pop()
Combines array elements into a string
join()
Combines array elements into a string
localeCompare()method
Combines array elements into a string
metacharacter
Combines array elements into a string
quantifier
Combines array elements into a string
push()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
23
The ____ method adds one or more elements to the end of an array.

A) pop()
B) push()
C) shift()
D) unshift()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
24
To sort elements of an array alphabetically, you use the ____ method.

A) arrange()
B) order()
C) list()
D) sort()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
25
To convert a JavaScript object to a JSON string, you use the ____ method.

A) convertToString()
B)json()
C)parse()
D)stringify()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
26
List and describe three metacharacters that you can use with JavaScript regular expressions.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
27
What are the toString()and toLocaleString()methods used for, and what is the difference between them?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
28
The ____________________ method of the String class creates a new string with the first instance of a specified pattern replaced with the value of the text argument.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
29
When applied to text strings, the term ____________________ refers to the act of extracting characters or substrings from a larger string.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
30
The ____ method removes and returns the first element from the beginning of an array.

A) split()
B) unshift()
C) shift()
D) slice()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
31
You use the ____ method of the String class to split a string into an indexed array.

A) toArray()
B) slice()
C) split()
D) shift()
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
32
Provide two different regular expressions that return true only when tested against a string consisting of exactly 5 characters.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
33
Explain how to change the case of a variable's valueusing the toLowerCase() or toUpperCase()method.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
34
Explain the difference between the shift()and unshift()methods of the Array object.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
35
_________________________ are patterns that are used for matching and manipulating strings according to specified rules.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
36
__________ is a data format that represents a JavaScript object as a string.
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
37
What is the primary difference between the search()method and the indexOf()method?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
38
How can you combine text strings with JavaScript?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
39
How can you match any metacharacters as literal values in a regular expression?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
40
What is the difference between the slice()and substring()methods?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
41
How do you create a character class with JavaScript?
Unlock Deck
Unlock for access to all 41 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 41 flashcards in this deck.