Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.log('I will only contain unique or distinct letter'.length); // 45
- let sentence = new Set('I will only contain unique or distinct letter');
- console.log( sentence.size); // 17
- for(letter of sentence){
- console.log(letter)
- }
- // 'I'
- // ' '
- // 'w'
- // 'i'
- // 'l'
- // 'o'
- // 'n'
- // 'y'
- // 'c'
- // 't'
- // 'a'
- // 'u'
- // 'q'
- // 'e'
- // 'r'
- // 'd'
- // 's'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement