1.7 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			1.7 KiB
		
	
	
	
	
	
	
	
id, title, challengeType, videoUrl, localeTitle
| id | title | challengeType | videoUrl | localeTitle | 
|---|---|---|---|---|
| bd7123c9c451eddfaeb5bdef | Use Bracket Notation to Find the Last Character in a String | 1 | Use la notación de corchete para encontrar el último carácter en una cadena | 
Description
var firstName = "Charles" , puede obtener el valor de la última letra de la cadena usando firstName[firstName.length - 1] . Instructions
lastName . Insinuación Intenta mirar la declaración de la variable
lastLetterOfFirstName si te quedas atascado. Tests
tests:
  - text: <code>lastLetterOfLastName</code> debe ser "e".
    testString: 'assert(lastLetterOfLastName === "e", "<code>lastLetterOfLastName</code> should be "e".");'
  - text: Tienes que usar <code>.length</code> para obtener la última letra.
    testString: 'assert(code.match(/\.length/g).length === 2, "You have to use <code>.length</code> to get the last letter.");'
Challenge Seed
// Example
var firstName = "Ada";
var lastLetterOfFirstName = firstName[firstName.length - 1];
// Setup
var lastName = "Lovelace";
// Only change code below this line.
var lastLetterOfLastName = lastName;
After Test
console.info('after the test');
Solution
// solution required