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
| 0x93b3a6911d0aa841952f51c3a823dde54798eaeb |
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
| // decorator to only allow function call after the timer is done. | |
| const throttle = (func, delay) => { | |
| let timeout; | |
| return function() { | |
| const context = this; | |
| const args = arguments; | |
| if (!timeout) { | |
| func.apply(context, args); | |
| timeout = true; | |
| setTimeout(() => timeout = false, delay); |
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
| # Intro to Prototypes | |
| ## JS Data Structures | |
| ### Outline | |
| * Objects in Javascript? | |
| * object literals | |
| * properties |
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
| # Ruby_Arrays | |
| days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] | |
| days.pop | |
| days.unshift("Sunday") | |
| puts days | |
| ============================================================================ | |
| Write code that would add the number 7 to "Erik's" favorite numbers. | |
| users = { | |
| "Jonathan" => { |