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
| var user = { | |
| "id": 1, | |
| "name": "Leanne Graham", | |
| "username": "Bret", | |
| "email": "[email protected]", | |
| "address": { | |
| "street": "Kulas Light", | |
| "suite": "Apt. 556", | |
| "city": "Gwenborough", | |
| "zipcode": "92998-3874", |
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
| var emailForm = document.getElementById('emailForm') | |
| function handleForm(event) { | |
| event.preventDefault(); | |
| var checkBox = document.getElementById("myCheck"); | |
| var myRemind = document.getElementById("remind"); | |
| var getEmail = document.getElementById('getEmail'); |
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
| export const mapObjectToArray = (obj) => ( | |
| Object.entries(obj || {}) | |
| .map(([key, value]) => ( | |
| typeof value === 'object' && !(value instanceof Array) ? | |
| { ...value, key } | |
| : | |
| { key, 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
| function validatePIN(pin) { | |
| if (pin.match(/^\d{4}$|^\d{6}$/) && (pin.length == 4 || pin.length == 6)){ | |
| return true; | |
| } | |
| else { | |
| return false; | |
| } | |
| } |
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
| function validateEmail(str) { | |
| if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)) | |
| { | |
| return (true) | |
| } | |
| return (false) | |
| } |