Welcome aboard! We are happy you are here and wish you good net-raft!
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
Type a string: <input type="text" id="myText">
<p></p>
<button type="button" onclick="checkForUnique()">Try it</button>
<p id="demo"></p>
<script type="text/javascript">
function checkForUnique(){
var hashtable = {};
var str = document.getElementById("myText").value;
for(var i=0,len=str.length;i<len;i++){
if (hashtable[str[i]] != null){
hashtable[str[i]] = 1;
document.getElementById("demo").innerText = "False";
return;
}else{
hashtable[str[i]] = 0;
}
}
document.getElementById("demo").innerText = "True";
return;
}
</script>
</body>
</html>
The most helpful JAVASCRIPT solutions
How can I get the last day and the next day in javascript ?JAVASCRIPT Click to see more ... 5.8K 507