Skip to content

Instantly share code, notes, and snippets.

View AlessioNovi's full-sized avatar

Alessio Novi AlessioNovi

View GitHub Profile
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);
}
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) {