This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function confirmEnding(str, target) { | |
var Newtarget = target.substring(-1); | |
var newString = str.substr(-1); // if i input str.substr(-1 -3); it will pass this test but fails the first one as expected | |
if (Newtarget.length > 1 ) { //OMG is this cheating the FCC test?? | |
newString = str.substr(-1 -3); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function confirmEnding(str, target) { | |
var Newtarget = target.substring(-1); | |
var newString = str.substr(-1); // if i input str.substr(-1 -3); it will pass this test but fails the first one as expected | |
if (newString == Newtarget) { |