Essential JavaScript

Going Further

Word Hunter Kata

Given an array of words, along with a target word, count how many times that word appears in the array.

For example:

const words = [ 'a', 'chicken', 'salsa', 'a', 'retro', 'salsa', 'retro', 'chicken', 'chicken' ]; const chickenCount = countWord(words, 'chicken'); console.log(chickenCount); // 3

Code Editor

Click "Run Tests" to execute your function and see the test results below.

Test Results

Run your code to see test results

Console Output

// Console output will appear here...

0 output lines