JSFiddle - React, Tailwind, and code Playground

by Andrew

JavaScript

function unqArr(str) {

	//char flag
	var unqHash = {};

	return str.split('').filter(function(c) {

		//this char has appeared
		if (unqHash[c])
			return false;

		//flag this char
		unqHash[c] = 1;
		return true;
	});
}

console.log(unqArr('javascript'));