06_Confirm_the_Ending.js
/*
Check if a string (first argument, str) ends with the given target string (second argument, target).

This challenge can be solved with the .endsWith() method, which was introduced in ES2015. 
But for the purpose of this challenge, 
we would like you to use one of the JavaScript substring methods instead.

Useful Methods
String.prototype.substr() 
String.prototype.substring() 
*/
Check if a string (first argument, str) ends with the given target string (second argument, target).
This challenge can be solved with the .endsWith() method, which was introduced in ES2015.
But for the purpose of this challenge,
we would like you to use one of the JavaScript substring methods instead.


Check if a string ( first argument str ) ends with the given target string ( second argument target ) . This challenge can be solved with the . endsWith () method which was introduced in ES2015 . But for the purpose of this challenge we would like you to use one of the JavaScript substring methods instead .
function confirmEnding(str, target) {
    var endingString= str.substr(-target.length);   
    if(endingString === target){
        return console.log(true);
    }
        return console.log(false);   
   }
function confirmEnding ( str , target ) { var endingString = str . substr ( - target . length ) ; if ( endingString === target ) { return console . log ( true ) ; } return console . log ( false ) ; }
Check if a string (first argument, str) ends with the given target string (second argument, target).
Check if a string ( first argument str ) ends with the given target string ( second argument target ) .
// The starting index and the length of characters to include in the resulting string //Chseck for strict equality