Pages

Sunday, June 19, 2016

Coding challenge that can be solved using Underscore's functions.

Check the array below to see if any of the words in it are less than 8 characters:

var array1 =["beautiful", "longing", "trepidation", "anxiety", "happiness", "excitement"];

I almost feel as though I wrote a poem there.  LOL.

The output should equal true if all words are 8 characters or more, and false any word is less than 8 characters.

Solution in the comments.

1 comment:

  1. var example = _.every(array1, function(item){
    return item.length >= 8;
    });

    ReplyDelete