Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Set objects Relation with Strings javascript

let text = 'India'

const mySet = new Set(text)  // Set(5) {'I', 'n', 'd', 'i', 'a'}
mySet.size  // 5

//case sensitive & duplicate omission
new Set("Firefox")  // Set(7) { "F", "i", "r", "e", "f", "o", "x" }
new Set("firefox")  // Set(6) { "f", "i", "r", "e", "o", "x" }
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #Set #objects #Relation #Strings #javascript
ADD COMMENT
Topic
Name
8+8 =