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
| //https://piccalil.li/blog/a-modern-css-reset | |
| /* Box sizing rules */ | |
| *, | |
| *::before, | |
| *::after { | |
| box-sizing: border-box; | |
| } | |
| /* Remove default margin */ |
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 reverse(x: number): number { | |
| const nums: string[] = [...(x.toString())]; | |
| const list: number[] = []; | |
| const negative: boolean = nums[0] == '-' ? true : false; | |
| if (negative) nums[0] = "\0"; | |
| nums.reverse().map(digit => { | |
| if (digit == "\0") return; | |
| list.push(Number(digit)); | |
| }) | |
| const result = Number(negative ? '-' + list.join('') : list.join('')); |
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 idk(key,size){ | |
| return [...key].map(x=>33*x.charCodeAt(0)%key.length).reduce((a,c)=>c+a); | |
| } | |
| console.log(idk('firstName', 113)) | |
| class table{ | |
| items = new Array(113); | |
| setItem(key, value){ | |
| const idx= idk(key, this.items.length); |
NewerOlder