Saturday, 18 February 2017

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

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...