unique letters in sring .. this code working in all brtowser but no in IE why ? what is solution for this
<html><head><script>
function code(n, digits, padChar) {
n = n.toString();
while (n.length < digits) {
n = padChar n;
}
return n;
}
var str = window.prompt("Enter String");
var array = [];
var totalCount;
var count=0;
for(var i = 0; i < str.length; i ){
if(!array[str[i]]) {
array[str[i]] = 1;
} else {
array[str[i]] = 1;
}
}
sortedArray = [];
for(var i in array){
sortedArray.push(code(i.charCodeAt(0), 5, '0'));
}
sortedArray.sort();
for(i = 0; i < sortedArray.length; i ){
count ;
}
document.write("Number of unique letters are: " count);
</script></head></html>