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 makeIndex() { | |
| return Math.random().toString(12).substring(2, 12); | |
| } | |
| function Awesome() { | |
| Object.defineProperty(this, 'index', { | |
| writable: false, | |
| configurable: false, | |
| value: makeIndex() | |
| }); |
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
| // Write a wrapper around the Web Animations API | |
| // takes a HTML element upon creation | |
| // constructor exposes the HTML element, a `keyframe` array of keyframe objects and a `config` object | |
| // the `keyframe` array has a minimum length of 2 (animation start and end), can't start an animation unless satisfied | |
| // each object in the `keyframe` array has a CSS property and value with an optional `offset` property (between 0 - 1, for keyframe %) | |
| // the config object specifies duration, easing and iterations |
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
| <style> | |
| .box { | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| margin: auto; | |
| } | |
| .red { | |
| width: 300px; |
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
| <span class="ball"></span> | |
| <span class="ball"></span> | |
| <span class="ball"></span> | |
| <span class="ball"></span> | |
| <span class="ball"></span> | |
| .ball { | |
| width: 20px; | |
| height: 20px; | |
| border-radius: 50%; |
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 getNumberOfPermutations(input) { | |
| if (!input.length) { | |
| return 0; | |
| } | |
| let { length } = input; | |
| let dividend = getFactorial(length); | |
| let divisor = 0 |
OlderNewer