<div id="non-repeating"></div>
var s = "aaabbcaaaaddeeef";
var s1 = s.split("").sort();
var s2 = [];
var current = null;
var count =0;
for(var i=0; i<s1.length; i++) {
	if(s1[i] != current) {
		if(current != null) {
			s2.push({data:current, cnt: count})
		}
		current = s1[i];
		count = 1;
	} else {
		count++;
	}
}


var non_repeating = s2.filter((x) => x.cnt == 1);
var element = document.getElementById("non-repeating");
if(non_repeating.length == 0) {
  non_repeating = "No non repeating character";
} else {
  non_repeating = non_repeating[0].data
}
element.innerHTML = non_repeating;

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.