SOURCE

function isUnique(s = '') {
    for (let i = 0; i < s.length; i++) {
        const c = s[i]
        const index = s.indexOf(c)
        if (index !== i) {
            return false
        }
    }
    return true
}

console.log(isUnique('abdfgf'))
console 命令行工具 X clear

                    
>
console