Looking to use JavaScript to compare two lists and extract words from WORDLIST that end with the characters in END (not in the middle of the word). I am also open to using jQuery for this task.
var WORDLIST = ['instagrampost', 'facebookpost', 'google']
var END = ['post', 'gle']
function compare() {
var final = WORDLIST.endsWith(END, END.length);
console.log(final);
}
// To do: count signs at end
// Extract words from end of WORDLIST based on length of END
// Save any matching words from WORDLIST as results