Hint # 3, basic code solution, and intermediate code solution employ a substr()
function.
However, MDN advises against:
Warning: Although
String.prototype.substr(…)
is not strictly deprecated (as in “removed from the Web standards”), it is considered a legacy function and should be avoided when possible. It is not part of the core JavaScript language and may be removed in the future. If at all possible, use thesubstring()
method instead.
Maybe it should be updated?