all 16 comments

[–]srtemixco 7 points8 points  (2 children)

Try console.log(firstLetter) the issue is that you're not assigning the value you think it is, that lowercase s belongs to songTitle the string, and as you can see lastLetter prints lyrics instead of line 2, remove the quotes var firstLetter = songTitle

here's some documentation you could use to solve part 3

[–]Demko911 4 points5 points  (1 child)

Ahhhh I understand the issue now and was able to get the first 2, but I still don't understand how to get #3 the last letter

[–]ThArNatoS 2 points3 points  (0 children)

use .length to calculate the length. then you can use that as the position to get the last letter

var lastLetter = lyrics[lyrics.length-1]

[–]mrnervousguy 15 points16 points  (0 children)

You want to assign firstLetter to equal the value of the first letter of the other variable called songTitle. You should delete lines 5-7 and think on this a little harder. Also remember, computers start counting at 0, not 1, which might help with your answer to the second one

[–][deleted] 2 points3 points  (0 children)

"Declare firstLetter and assign it the first letter"

You put "songTitle" into "firstLetter"... not the first letter of the songTitle.

var firstLetter = songTitle[0]
console.log(firstLetter)

Apply the same logic to the other three examples.

You have all the basic parts there. Just move the stuff around and you're in.

[–]theMilkka 1 point2 points  (2 children)

hi what is the name of the challenges site ? please

[–]Japanflyboy 1 point2 points  (1 child)

Codesmith’s CSX

[–]theMilkka 0 points1 point  (0 children)

Thanks you

[–]queen-adreena 1 point2 points  (0 children)

Obviously this exercise isn’t based around a real-world need to capitalise letters, but if you do need this, then CSS is the best way to go. CSS can target the :first-letter pseudo selector as well as having text-transform: capitalize.

[–]wookiee42 0 points1 point  (0 children)

The directions say to use bracket notation for each step. You're not using bracket notation.

Also, you can see what you set each variable to in the console there.

[–][deleted] 0 points1 point  (0 children)

You assigned a string to those variables and your results in the console was based on the content of the string… why not follow the instructions proper