Ad
  • Custom User Avatar

    I think the instructions could be better phrased.

    IMO, it would be clearer with a few differences:

    "In this Kata, we will check if a string only contains consecutive letters, as they appear in the English alphabet, and if each letter occurs only once"

    i'd add another example to make it very clear:
    'hfigje' expects true because it contains: 'e', 'f', 'g', 'h', 'i', 'j'

  • Custom User Avatar

    for whoever might have the same question in the future:

    .filter() is passing the element from array as argument (hence the "e") to a function: everything inside the parentesis of .filter() is a function. filter evaluates the expression for each element as true of false and returns every element that evaluated as true.

    since filter receives a function as argument that is then called by filter, this is what is called callback functions. Filter requires a callback function to filter an array.

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter

  • Custom User Avatar

    thank you for sharing your experience