This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Category | |
| { | |
| public string Id { get; set; } | |
| public string Name { get; set; } | |
| public ApplicationUser User { get; set; } | |
| public string UserId { get; set; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let arr = [ 13, 11, 15, 21, 13, 11, 17, 17, 19, 19, 21 ]; | |
| let uniqueArray = [...new Set(arr)]; | |
| console.log(uniqueArray); // [13, 11, 15, 21, 17, 19] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let obj = {}; | |
| console.log(obj['toString']) | |
| console.log(obj['hasOwnProperty']) | |
| console.log(obj['constructor']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let set = new Set([9, 15]); | |
| set.add(44); | |
| let arr = [...set]; | |
| console.log(arr); // [9, 15, 44] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let set = new Set([3, 5, true, 'This is a string, obviously.']); | |
| for (let item of set) { | |
| console.log(item); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let map = new Map([['name', 'CodingBlast'], ['points', 33], [true, 55], ['true', 44]]) | |
| console.log(Array.from(map.keys())) | |
| console.log(Array.from(map.values())) | |
| console.log(Array.from(map.entries())) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let map = new Map([['name', 'CodingBlast'], ['points', 33], [true, 55], ['true', 44]]) | |
| console.log(map.get(true)) | |
| console.log(map.get('true')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (let key of map.keys()) { | |
| console.log('key:' + key); | |
| } | |
| for (let value of map.values()) { | |
| console.log('value:' + value); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let map = new Map([['name', 'CodingBlast'], ['points', 33], [true, 55], ['true', 44]]) | |
| for (let [key, value] of map.entries()) { | |
| console.log('key is ' + key + ', value is ' + value); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let set = new Set([3, 5, true, 'This is a string, obviously.']); | |
| for (let item of set.values()) { | |
| console.log(item); | |
| } | |
| console.log('Adding a new value'); | |
| set.add(5); | |
| for (let item of set.values()) { |