- Check for an existing
.gitignorefile in the project directory
ls -a| [ | |
| { "country": "Austria", "code": "AT" }, | |
| { "country": "Belgium", "code": "BE" }, | |
| { "country": "Bulgaria", "code": "BG" }, | |
| { "country": "Croatia", "code": "HR" }, | |
| { "country": "Cyprus", "code": "CY" }, | |
| { "country": "Czech Republic", "code": "CZ" }, | |
| { "country": "Denmark", "code": "DK" }, | |
| { "country": "Estonia", "code": "EE" }, | |
| { "country": "Finland", "code": "FI" }, |
| const store = createStore((state = { counter: 0 }, action) => { | |
| switch(action.type) { | |
| case "INCREMENT": | |
| return { counter: state.counter + 1 } | |
| case "DECREMENT": | |
| return { counter: state.counter - 1 } | |
| default: | |
| return state | |
| } | |
| }) |
| function mapValues(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| result[key] = fn(obj[key], key); | |
| return result; | |
| }, {}); | |
| } | |
| function pick(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| if (fn(obj[key])) { |
that I bookmarked but never had enough time to read
| /* *-*-*-*-*-*-*-*-*-*-* Challenge 1 ------------------ | |
| Create a variable with the type number and assign it an arbitrary value | |
| */ | |
| // ---------------------------------------------------- | |
| // *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- | |
| // ---------------------------------------------------- | |
| /* *-*-*-*-*-*-*-*-*-*-* Challenge 2 ------------------ | |
| Create a variable with the type string and use the addition operator to put two arbitrary words together | |
| */ |
| /* | |
| * Demonstrate JavaScript floating point math bugs by showing | |
| * which two-decimal-place numbers between 0.00 and 1.00 inclusive | |
| * have fractional parts after being multiplied by one hundred. | |
| */ | |
| var i = 0.00; | |
| for (n = 0; n <= 100; ++n) { | |
| j = i * 100; | |
| if (Math.round(j) != j) { |
| /** | |
| * Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt(). | |
| * (c) Chris Veness MIT Licence | |
| * | |
| * @param {String} plaintext - Plaintext to be encrypted. | |
| * @param {String} password - Password to use to encrypt plaintext. | |
| * @returns {String} Encrypted ciphertext. | |
| * | |
| * @example | |
| * const ciphertext = await aesGcmEncrypt('my secret text', 'pw'); |