Return the first non-repeating character in the string.
Anonymous
const citizen = 'indian'; for (var i = 0; i < citizen.length; i++) { var c = citizen.charAt(i); if (citizen.indexOf(c) == i && citizen.indexOf(c, i + 1) == -1) { console.log(c); } }
Check out your Company Bowl for anonymous work chats.