Js exercise 23


#1

Tank you rcodeman but it does,nt work, start end is not recognize.
In addition we should use the sluck based on substring(x,y).
In fact my instruction works and give the right result which is "Melbourne is great"
but I don't understand why the codeacademy exercise gives the error "Oops, try again. You didn't select the right substring from 'Melbourne is great'."


#2

Thank you rcodman but your code doesn't work.
In fact my code works and it is right displayed but I don't understand why i have the error
"Oops, try again. You didn't select the right substring from 'Melbourne is great'."
In addition the exercise is based on using substring positions.


#3

Thank you msfrisby,

In fact my code works and it is right displayed but I don't understand why iI have the error
"Oops, try again. You didn't select the right substring from 'Melbourne is great'."


#4

@arraywhiz98010, please reply in this new topic, otherwise your post will be hidden


#5

I don't understand what you mean.
My message was not a spam.


#6

No, your messages are not spam. But you are using the same network, which triggers a spam filter. jsoule2004yahoo.fr and you use the same network


#7

Please could you tell me if it is possible to bypass an error and how when we don't find a right solution or when it seems you have a bug for example on the exercise N° 23 in Javascript.
Thank you.


#8

Thank you stetim94 for the explanation.
Please could you tell me if it is possible to bypass an error and how when we don't find the right solution or when it seems you have a bug for example on the exercise N° 23 in Javascript.
In case of error will it be possible to access the solution of the exercise not only to get a hint?
Thank you.


#9

Can i see the code you are currently using?


#10

console.log("Melbourne is".substring(0,12) + " great");


#11

This is the code
console.log("Melbourne is".substring(0,12) + " great");


#12

The result is correct and well displayed.
Why an error? Bug?
Thank you


#13

if you want to have a sub-string, you put it at the end of the string:

console.log("Melbourne is great".substring(0,12))

substring is at the end, so you can get a substring of the string you are having. Otherwise you might just as well just write part of the string


#14

Sorry but the exercice will consist to get "Melbourne is" in "Melbourne is great" (note the space!)" using substring like console.log( "hello".substring(0, 2) );
Thank you.


#15

@arraywhiz98010 Did you figure it out? "hello".substring(0, 2) --> he. But to compare to your program it is like writing "he".substring(0, 2) instead. Try reviewing @stetim94's answer one more time :slight_smile:


#16

Well, then the numbers in your substring aren't correct. If it grabs more then you want, review the numbers (0 and 12)


#17

can you give me the screen shot?

@arraywhiz98010


#18

@stetim94 I think maybe he is referring to where the instruction remind the user not to forget to count the space between "Melbourne" and "is"?


#19

Hello everyone, can someone help me understand this correctly:
Substrings:
0123456
January J has the number of 0 correct? and N has the number of 2. So if I want to see JAN
I would put this after my substring correct: (0, 2)?
012
JAN

Please review my screenshot.
Thanks in advance


#20

@erickr00, I believe the substring cuts off before the second number. Therefore think of what actual (not array index) number letter you want to go up to and include (e.g. JAN --> 3) and make that nth letter the second number in your parameter.