Skip to content

Commit aa13d05

Browse files
authored
Format markdown with prettier (#15)
1 parent a8d944e commit aa13d05

9 files changed

+501
-66
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Here I've noted only questions from my interviews.
4242
- https://github.com/ajzawawi/js-interview-prep A collection of JS interview questions ~~updated every day~~
4343
- https://github.com/monkey3310/full-stack-interview Full Stack Interview Questions & Answers (inc. js-stack)
4444
- https://github.com/sudheerj/reactjs-interview-questions List of top 222 ReactJS Interview Questions & Answers
45-
- https://github.com/Pau1fitz/react-interview List of common React interview questions.
45+
- https://github.com/Pau1fitz/react-interview List of common React interview questions.
4646
- https://github.com/ElemeFE/node-interview How to pass the Node.js interview of ElemeFE
4747
- https://www.adaface.com/blog/react-interview-questions/ 100+ React Interview Questions (2020)
4848

@@ -80,7 +80,6 @@ Here I've noted only questions from my interviews.
8080
- https://interviewbuddy.in
8181
- http://www.gainlo.co
8282

83-
8483
If you're ready to share your experience - you're welcome. Make PR to related file ( by topic ) or create issue with list of questions
8584

8685
**_P.S._** it worth to check **_*'Cracking the Coding Interview'*_** by Gayle Laakmann McDowell ( solutions can be founded at https://github.com/careercup/CtCI-6th-Edition , book (at least 5th edition can be googled )

topics/closures.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# Closures
22

33
What is the output? ( How make it correct )
4+
5+
<!-- prettier-ignore-start -->
46
```javascript
57
for (var i = 0; i < 5; i++) {
68
setTimeout(function() {
79
console.log(i);
810
}, 1000);
911
}
1012
```
13+
<!-- prettier-ignore-end -->
1114
---
1215
What is the output?
16+
<!-- prettier-ignore-start -->
1317
```javascript
1418
var func = [];
1519
for (var i = 0; i < 5; i++) {
@@ -19,23 +23,29 @@ for (var i = 0; i < 5; i++) {
1923
}
2024
func[3]();
2125
```
26+
<!-- prettier-ignore-end -->
2227
---
2328
What is the output?
29+
<!-- prettier-ignore-start -->
2430
```javascript
2531
(function() {
2632
var a = b = 5;
2733
})();
2834
console.log(b);
2935
```
36+
<!-- prettier-ignore-end -->
3037
---
3138
Create code for next conditions
39+
<!-- prettier-ignore-start -->
3240
```javascript
3341
function calculate() {/* put your code here */}
3442
calculate('+')(1)(2); // 3
3543
calculate('*')(2)(3); // 6
3644
```
45+
<!-- prettier-ignore-end -->
3746
---
3847
Create code for next conditions
48+
<!-- prettier-ignore-start -->
3949
```javascript
4050
var sum = function() { /* put your code here */};
4151
var s = sum();
@@ -44,19 +54,24 @@ alert(s(1)); // 1
4454
alert(s(1)(2)); //3
4555
alert(s(3)(4)(5)); // 12
4656
```
57+
<!-- prettier-ignore-end -->
58+
59+
## lighter version might use `sum(1)(2)()` with empty `()` at the end
4760

48-
lighter version might use `sum(1)(2)()` with empty `()` at the end
49-
---
5061
What is the output?
62+
63+
<!-- prettier-ignore-start -->
5164
```javascript
5265
(function(x) {
5366
return (function(y) {
5467
console.log(x);
5568
})(2)
5669
})(1);
5770
```
71+
<!-- prettier-ignore-end -->
5872
---
5973
What do next code do?
74+
<!-- prettier-ignore-start -->
6075
```html
6176
<button id="btn-0">Button 1!</button>
6277
<button id="btn-1">Button 2!</button>
@@ -72,8 +87,10 @@ What do next code do?
7287
}
7388
</script>
7489
```
90+
<!-- prettier-ignore-end -->
7591
---
7692
what output will be?
93+
<!-- prettier-ignore-start -->
7794
```javascript
7895
const fn = () => {
7996
let a = 1;
@@ -90,8 +107,10 @@ const fnRes2 = fn();
90107
alert(fnRes2());
91108
alert(fnRes2());
92109
```
110+
<!-- prettier-ignore-end -->
93111
---
94112

113+
<!-- prettier-ignore-start -->
95114
```javascript
96115
/*
97116
- Do you understand the closure?
@@ -108,3 +127,4 @@ console.log(hof(3, 4)(5, 6)(7)); // 25
108127
console.log(hof(4, 5)(6)(7, 8)); // 30
109128
console.log(hof(5)(6)(7)(8)(9)); // 35
110129
```
130+
<!-- prettier-ignore-end -->

0 commit comments

Comments
 (0)