JSFiddle - React, Tailwind, and code Playground

by Shashi Kumar Nagulakonda

JavaScript

var results = ["x", "abc", "x1", "xyz"].filter(RegExp.prototype.test, /^x/);
console.log(results);