Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/betomoedano/JavaScript-Coding-Interview-Questions
/ isUnique
Function
isUnique
strings/isUnique.js:1–5 ·
view source on GitHub ↗
(string)
Source
from the content-addressed store, hash-verified
1
function
isUnique(string) {
2
if
(string.length === 0)
return
string;
3
const
regex = / /g;
4
return
string.replace(regex,
"%20"
);
5
}
6
7
const
string =
"Mr Jhon Smith "
;
8
console.log(isUnique(string));
Callers
1
isUnique.js
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected