Javascript Challenge #8: Filter by Starting & Ending of String

This is another javascript challenge where we will filter array by starting and ending word. I hope you will enjoy.

const myArray = [
    'Blue Sky',
    'light green',
    'dark Green',
    'Blue Van'
];

function getStartswith(wordsArray, word) {
    return wordsArray.filter(myword => myword.toLowerCase().startsWith(word));
}

function getEndswith(wordsArray, word) {
    return wordsArray.filter(myword => myword.toLowerCase().endsWith(word));
}

const result = getStartswith(myArray, 'blue');

console.log(result);