Consider the following statement:
var str = "Hello World!";
What is the length and the last index of the string str
?<<
( ) Length: 11, Last Index: 10 {{Incorrect because the whitespace and the exclamation mark counts towards the length of the string.}} ( ) Length: 11, Last Index: 11 {{Incorrect because the whitespace and the exclamation mark counts towards the length of the string.}} (x) Length: 12, Last Index: 11 {{Correct because the last index of a string is always the length minus 1.}} ( ) Length: 12, Last Index: 12 {{Incorrect because the last index of a string is always the length minus 1.}} ( ) Length: 13, Last Index: 12 {{Incorrect because the string has a length of 12 (10 letters, one whitespace, one symbol).}}
||The whitespace and the exclamation mark both counts towards the length of the string.||