What are the 2 operators used to build and concatenate strings?
What is a string method you could also use to achieve this?
+
+=
const str1 = 'Hello';
const str2 = 'World';
str1.concat(' ', str2);What are the 2 ways to access a single character in a string?
*When using bracket notation for character access, attempting to delete or assign a value to these properties will not succeed
let s= "1+2" what does eval(s) return?
3
What symbol is used for escape notation within a string literal?
\
What can you include inside of string “” to indicate that the string value will continue on the next line?
\ let str= "This is \a very long string";
.includes()
.endsWith()
What method(s) could you use to determine if a string can be found within another string?
.includes()
myString.includes(“another string”)
returns true/false
indexOf()
myString.indexOf(searchTerm)
returns -1 if term does not exist in the string
What method could you use to determine if a string ends with the characters of a specified string?
.endsWith()
myString.endsWith(“another string”)
returns true/false
.indexOf()
2. const paragraph = 'The quick brown fox jumps'; const searchTerm = 'fox'; const indexOfFirst = paragraph.indexOf(searchTerm);