javascript : Array.distinct()
javascript : Array .distinct() Target: Applicable with Array Data Type. Description : It remove duplicate items from array and create new array having distinct values/objects. It is an extension method of array object defined in array prototype. Note: logic behind it is create a new array and push only that items which are not contains in array. Syntax: [] .distinct() return new array having unique and distinct values. Usase: [1,2,5,8,4,2,6,3,5,1,3,4,5].distinct() It return new array [1, 2, 5, 8, 4, 6, 3] "Welcome in myjs tutorials".toArray().distinct() It return new array ["W", "e", "l", "c", "o", "m", " ", "i", "n", "y", "j", "s", "t", "u", "r", "a"] "Welcome in myjs tutorials".toCharCodeArray().distinct() It return new array [{"char":"W","code":87},{"char":"...