Write a function called "filterEvenLengthWords".

Given an array of strings, "filterEvenLengthWords" returns an array containing only the elements of the given array whose length is an even number.

var output = filterEvenLengthWords(['word', 'words', 'word', 'words']);

console.log(output); // --> ['word', 'word']

Difficulty: introductory

Starter code:

def filter_even_length_words(words):
	

Solutions:
def filter_even_length_words(words):
    return [word for word in words if len(word) % 2 == 0]

def filter_even_length_words(words):
    even_words_array=[]
    for i in words:
      if len(i)%2==0:
        even_words_array.append(i)
    return even_words_array


def filter_even_length_words(words):
    ret = []
    for w in words:
        if len(w) % 2 == 0:
            ret.append(w)
    return ret

def filter_even_length_words(words):
    return [w for w in words if len(w) % 2 == 0]

def filter_even_length_words(words):
    return [el for el in words if len(el) % 2 == 0]

filter_even_length_words = lambda w: [x for x in w if len(x) % 2 == 0]

def filter_even_length_words(words):
    arr = []
    for el in words:
        if len(el) % 2 == 0:
            arr.append(el)
    return arr

def filter_even_length_words(words):
    s = []
    for el in words:
        if len(el) % 2 == 0:
            s.append(el)
    return s