hi im trying to learn how to code but this substringing has got me stumped lol anyone got any pointers.




google search
== the book ==
javascript substring()

== discussions / opinions ==
javascript substring()


This is final code:
"wonderful day".substring(3, 7);


but shouldn't the 7th letter equal the number 6 instead of 7 ??


.substring(3, 7) takes indices 3, 4, 5, and 6. It is a bit confusing! :slightly_smiling:


In programming, numbers start at zero. So in substring, say you want to cut out "Goo" in "Google":
"Google".substring(0, 3);

Take a look here if you want to learn more:

If you have any other questions, feel free to reply. :slightly_smiling:


How are you doing now @d4rb?


Probably used an hour trying to figure out why my code didnt work. Had an uppercase "W" in wonderful


I still don't get it. My code
console.log("Melbourne is great").substring(0,11));


You can't use .substring() on a function like console.log().

Read earlier posts, and figure out your problem.