function getFirstNonRepeatedCharacter(s) {
let length = s.length;
for (let i = 0; i < length; i++) {
if(s.indexOf(s[i]) === s.lastIndexOf(s[i])) {
return s[i];
}
}
return null;
}
const s = 'ppdadxefe';
console.log(getFirstNonRepeatedCharacter(s));
/*
run:
a