← Back to challenges

Are Letters in the Second String Present in the First?

JavaScriptHardstringsvalidationregex

Instructions

Create a function that accepts an array of two strings and checks if the letters in the second string are present in the first string.

Examples

letterCheck(["trances", "nectar"]) ➞ true

letterCheck(["compadres", "DRAPES"]) ➞ true

letterCheck(["parses", "parsecs"]) ➞ false

Notes

  • Function should not be case sensitive (as indicated in the second example).
  • Both strings are presented as a single argument in the form of an array.
  • Bonus: Solve this without RegEx.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Face Interval