A bug in lesson 26.Change the variable values


#1

My genius mind found a short cut in this exercise. Instead of doing the whole 4 steps you can do this simple 3 step resolution.

Code:
var myName = "billy"

       console.log(myName);
      
       console.log("myName".substring(0,2) );

this is the code now my genius mind is going to find other resolutions to this .... code


#2

I bet that doesn't print out bi.

:green_heart:


#3

amateur try it for your self


#4


#5

not on a note pad on the website in lesson 26 the whole piece of code


#6

I don't know what you are trying to tell me.


#7

do it in lesson 26, watch it will work


#8

I don't see how it could work, but okay, I will try. Here is what i see:


#9

console.log("myName".substring(0,2)); prints the first two letters of the string "myName" and not of the variable myName = "billy"

I also get "my" as an output


#10

you have to remove the quotes :wink:
console.log(myNametest.substring(0,2) );
and you get "bi" as an output :slight_smile:


#11

No! @internal has the correct way. @internal is always correct. @internal is love. @internal is life!


#12

var myNametest = "billy"
console.log(myNametest);
console.log(myNametest.substring(0,2) );

this code works for me ....


#13

I still believe @internal. In my experience, he is always correct.


#14

you can try it yourself


#15

I have. It doesn't work:


#16

yeah it says syntaxError because of the sentence "this code works for me...." delete this sentence in your editor :smirk:


#17

Haha. Just messing with you :wink:


#18

i know i am always right


#19

We know too! :smile: