Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuleicul/bfe.dev
Visualized solutions to BFE.dev
https://github.com/yuleicul/bfe.dev
currying interview javascript throttle
Last synced: 17 days ago
JSON representation
Visualized solutions to BFE.dev
- Host: GitHub
- URL: https://github.com/yuleicul/bfe.dev
- Owner: yuleicul
- License: cc0-1.0
- Created: 2023-08-13T11:37:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-17T09:26:56.000Z (about 1 year ago)
- Last Synced: 2024-10-14T04:54:55.439Z (about 1 month ago)
- Topics: currying, interview, javascript, throttle
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BFE.dev
Visualizations to solutions, made with [excalidraw-claymate](https://github.com/dai-shi/excalidraw-claymate).
And some explaining videos, blogs, etc.
## JavaScript Coding Questions
### [`curry()` with placeholder](https://bigfrontend.dev/problem/implement-curry-with-placeholder)
![excalidraw-claymate](https://github.com/yuleicul/bfe.dev/assets/27288153/2e0e14a4-fd79-48da-bea5-0c73a01e9aea)
### [Basic `throttle()`](https://bigfrontend.dev/problem/implement-basic-throttle)
throttled Kirby:
![excalidraw-claymate-throttle](https://github.com/yuleicul/bfe.dev/assets/27288153/72bdc0f5-3bf5-49f1-883d-7a79956b5b4e)more to read/watch:
- code: https://youtu.be/cjIswDCKgu0
- visualized: https://css-tricks.com/debouncing-throttling-explained-examples/### [Can you `shuffle()` an array?](https://bigfrontend.dev/problem/can-you-shuffle-an-array)
```javascript
// Fisher-Yates
function shuffle(arr) {
for(let i = arr.length - 1; i >= 0; i--) {
const index = Math.floor(Math.random() * (i + 1))
;[arr[i], arr[index]] = [arr[index], arr[i]]
}
return arr
}// Why this doesn't work?
// There's no problem with `const index = Math.floor(Math.random() * arr.length)`
// Every position does get a correct possibility,
// but the number in the position changes because of `splice`
// Fisher-Yates can make sure the number in some position keep the same
// function shuffle(arr) {
// const result = []
// const length = arr.length
// for (let i = 0; i < length; i++) {
// const index = Math.floor(Math.random() * arr.length)
// result.push(arr[index])
// arr.splice(index, 1)
// }// return result
// }
```### [Decode message](https://bigfrontend.dev/problem/decode-message)
![excalidraw-claymate-decoder](https://github.com/yuleicul/bfe.dev/assets/27288153/3cd877a2-6a54-407c-8a74-a9f62ba9ac2b)
### [Detect data type in JavaScript](https://bigfrontend.dev/problem/detect-data-type-in-JavaScript)
![image](https://github.com/yuleicul/bfe.dev/assets/27288153/773accde-0681-4fc9-b9c9-1307e293d231)