Why no love for regex?
Updated to support unicode characters and use ES6 features
let name="ÇFoo Bar 1Name too ÉLong";
let rgx = new RegExp(/(\p{L}{1})\p{L}+/, 'gu');
let initials = [...name.matchAll(rgx)] || [];
initials = (
(initials.shift()?.[1] || '') + (initials.pop()?.[1] || '')
).toUpperCase();
console.log(initials);