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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Document</title> | |
| <style> | |
| body { | |
| margin: 0; |
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
| const firstWordTitleCase = str => str.split(' ').map((word, index) => index === 0 ? word[0].toUpperCase() + word.slice(1).toLowerCase() : word.toUpperCase()).join(' '); | |
| 'This is bird.it can fly.thank you.'.split('.').filter(line => line).map(firstWordTitleCase).join('\n'); |
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
| class User { | |
| constructor(username, password, loggedIn = false) { | |
| this.username = username; | |
| this._password = password; | |
| this.loggedIn = loggedIn; | |
| } | |
| set password (pwd) { this._password = pwd }; | |
| get password () { return '*'.repeat(this._password.length); }; |
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
| class User { | |
| constructor(name, password, loggedIn = false) { | |
| this.username = name; | |
| this._password = password; | |
| this.loggedIn = loggedIn; | |
| } | |
| set password (pwd) { this._password = pwd }; | |
| get password () { return '*'.repeat(this._password.length); }; |
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
| const fizzBuzz = { | |
| [Symbol.iterator]() { | |
| let i=0; | |
| return { | |
| next() { | |
| return { done: i++ >= 100, value: i % 15 === 0 ? 'FizzBuzz' : i % 5 === 0 ? 'Buzz' : i % 3 === 0 ? 'Fizz' : i }; | |
| } | |
| } | |
| } | |
| } |
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
| const userProxy = { | |
| get: function (target, name) { | |
| return name === 'password' ? '*'.repeat(target.password.length) : target[name]; | |
| } | |
| } | |
| // or shorter | |
| const userProxy = { | |
| get: (target, name) => name === 'password' ? '*'.repeat(target.password.length) : target[name], |
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
| const people = [ | |
| { firstName: 'Sam', lastName: 'Hughes', DOB: '07/07/1978', department: 'Development', salary: '45000' }, | |
| { firstName: 'Terri', lastName: 'Bishop', DOB: '02/04/1989', department: 'Development', salary: '35000' }, | |
| { firstName: 'Jar', lastName: 'Burke', DOB: '11/01/1985', department: 'Marketing', salary: '38000' }, | |
| { firstName: 'Julio', lastName: 'Miller', DOB: '12/07/1991', department: 'Sales', salary: '40000' }, | |
| { firstName: 'Chester', lastName: 'Flores', DOB: '03/15/1988', department: 'Development', salary: '41000' }, | |
| { firstName: 'Madison', lastName: 'Marshall', DOB: '09/22/1980', department: 'Sales', salary: '32000' }, | |
| { firstName: 'Ava', lastName: 'Pena', DOB: '11/02/1986', department: 'Development', salary: '38000' }, | |
| { firstName: 'Gabriella', lastName: 'Steward', DOB: '08/26/1994', department: 'Marketing', salary: '46000' }, | |
| { firstName: 'Charles', lastName: 'Campbell', DOB: '09/04/1977', department: 'Sales', salary: '42000' }, |
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
| const orders = [ | |
| { orderId: '123', customerId: '123', deliveryDate: '01-01-2020', delivered: true, items: [ | |
| { productId: '123', price: 55 }, | |
| { productId: '234', price: 30 }, | |
| ]}, | |
| { orderId: '234', customerId: '234', deliveryDate: '01-02-2020', delivered: false, items: [ | |
| { productId: '234', price: 30 }, | |
| ]}, | |
| { orderId: '345', customerId: '234', deliveryDate: '05-01-2020', delivered: true, items: [ | |
| { productId: '567', price: 30 }, |
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
| const users = [ | |
| { id: '88f24bea-3825-4237-a0d1-efb6b92d37a4', firstName: 'Sam', lastName: 'Hughes' }, | |
| { id: '2a35032d-e02b-4508-b3b5-6393aff75a53', firstName: 'Terri', lastName: 'Bishop' }, | |
| { id: '7f053852-7440-4e44-838c-ddac24611050', firstName: 'Jar', lastName: 'Burke' }, | |
| { id: 'd456e3af-596a-4224-b1dc-dd990a34c9cf', firstName: 'Julio', lastName: 'Miller' }, | |
| { id: '58a1e37b-4b15-47c1-b95b-11fe016f7b64', firstName: 'Chester', lastName: 'Flores' }, | |
| { id: 'b4a306cb-8b95-4f85-b9f8-434dbe010985', firstName: 'Madison', lastName: 'Marshall' }, | |
| { id: '6ee904be-e3b0-41c9-b7a2-5a0233c38e4c', firstName: 'Ava', lastName: 'Pena' }, | |
| { id: '7f0ce45a-bdca-4067-968b-d908e79276ce', firstName: 'Gabriella', lastName: 'Steward' }, | |
| { id: '9e525c2d-6fcd-4d88-9ac4-a44eaf3a43e6', firstName: 'Charles', lastName: 'Campbell' }, |
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
| const users = [{ | |
| id: "e0aafb31-8ac6-48d4-99ee-12af8ddcbdae", | |
| email: "tcasaletto0@soundcloud.com", | |
| ip_address: "53.215.156.73" | |
| }, { | |
| id: "a7b0221d-5228-4992-a964-b5f3e3d7a022", | |
| email: "nmoffett1@paginegialle.it", | |
| ip_address: "34.81.219.4" | |
| }, { | |
| id: "1019b52c-db9d-45a2-975f-404455925a6a", |