+ 7
var Jake = "Gybjo";
var Joke = Jake.substring(0, 4);
https://code.sololearn.com/WaMjvuVF6fu0/#js
+ 11
var Jake = "Gybjo", Res = "";
for(var i = 0; i < Jake.length-1; i++) {
Res += Jake[i];
}
alert(Res);
// EDIT -- Actually, @Netkos Ent has a better and simple way of doing it, of course.
+ 7
@Forge Ice : I know its not for me, but you should use var e=jai.substring(0, x); instead of 'ja' so as to get the inner value of your <div>
+ 4
@Forge Ice You're more than welcome bro. Btw, although the way I posted is the more efficient way, take a look at what Dev posted to you. It's a great example of how you can utilize loops to iterate through your string array, which is very useful for many other situations, so take note of what he did there and ask questions if you need to. So many ways of going about the same problems, and each way has its more useful scenarios, so obtain the knowledge from both methods.
Best of luck!
+ 1
https://code.sololearn.com/War1v16Ym8b8/?ref=app
Just looking at options :)
+ 1
@Netkos niiice!! ive got to know what that substring () does... thats very few lines..
Im still new to JS :'(
0
or u can just tell me here :)