Monday, May 13, 2019

javascript - how to use substring function and what does this mean?

so i'm currently trying to figure out what the code below will output. I'm confused by the substr function so if you could explain that it would be amazing. Thanks





    function getAttackString() {
var foo = "d32329b34";
var bar = "x38h309hj";
return "The code is: "+(foo.substr(3,foo.length-6))+(bar.substr(2));
}


console.log(getAttackString());


No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...