Confirm the Ending

Check if a string (first argument, str) ends with the given target string (second argument, target).

My approach is using string.substring() method. First, I played around with .substring() method in console.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.