const candidate = ['Jimmy', 'Rayn', 'Jack', 'Vladimir', 'joen', ];
const friend = candidate.filter(item => item[0] == /J/i ? true : false)
console.log(friend)
const candidate = ['Jimmy', 'Rayn', 'Jack', 'Vladimir', 'joen', ];
const friend = candidate.filter(item => item[0].match(/J/i))
console.log(friend)
const arr = ['Jimmy', 'Rayn', 'Jack', 'Vladimir', 'joen'];
let res = arr.filter(el => /J/i.test(el[0]));
console.log(res);