Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/School-Work / School Work/Turn Objects into Flexible Arrays/Unique.js |
| Date | Not specified in source |
| Repository | Janady13/School-Work |
| Revision | 4a666c890caf7c43c47d0572dbcc287373c7a78e |
| Branch | main |
| Path or archive member | School Work/Turn Objects into Flexible Arrays/Unique.js |
| Original SHA-256 | 82ddc3dab0e3c71f86a5f3cf5b8361ee466cecefd2a5b135c06ff42e4e9fc2cc |
| Git blob SHA | 83c73b4ce89fbed7aed3df142061bf0c0411df7c |
| Reading-copy SHA-256 | 82ddc3dab0e3c71f86a5f3cf5b8361ee466cecefd2a5b135c06ff42e4e9fc2cc |
Recovered source transcript
Download complete source text ↓34 lines · 0.8 KB
const customerDishes = [
"Chicken Wings",
"Fish Sandwich",
"Beef Stroganoff",
"Grilled Cheese",
"Blue Cheese Salad",
"Chicken Wings",
"Reuben Sandwich",
"Grilled Cheese",
"Fish Sandwich",
"Chicken Pot Pie",
"Fish Sandwich",
"Beef Stroganoff"
];
// a set forces uniqueness within its elements
new Set([1, 2, 3, 4, 5, 6, 7, 8, 0]).size
//the size element doesn't allow repenting elements
new Set2([1,1,2,3,4,5]).size
// it would throw out the repeating number
new Set3 ([[1],[2],[3],[3],[3]])
// But it will not throw out seperate arrays to get the values of a set we have to iterate over it. You can use a foorloop
for (const num of numbers) {
console.log(num)
}
//This is one way to keep arrays from repeating themselves and keep things from repeating.