Skip to content

Commit 9021630

Browse files
authored
Add JS question
1 parent ef0fa60 commit 9021630

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ I hope my experience and the experiences of other developers will help you get b
8989
1. What patterns do you know and successfully use in JavaScript?
9090
1. What is the difference between Deferred and Promise objects? Where is Deferred object used?
9191
1. What is the problem throttling and debouncing are resolved? What is the core difference between them? - [@answer--medium](https://medium.com/@_jh3y/throttling-and-debouncing-in-javascript-b01cad5c8edf)
92-
1. What is SOLID? [@answer-wiki](https://en.wikipedia.org/wiki/SOLID_(object-oriented_design))
92+
1. What is SOLID? [@answer-wiki](https://en.wikipedia.org/wiki/SOLID_(object-oriented_design))
93+
1. What is the difference between inheritance and composition? What do you prefer? Why? [@answer-hackernoon.com](https://hackernoon.com/javascript-functional-composition-for-every-day-use-22421ef65a10), [@answer--medium](https://medium.com/front-end-hacking/classless-javascript-composition-over-inheritance-6b27c35893b1)
9394

9495
## Javascript Coding Questions
9596
* Write a `pipefy` function where a string received is returned, but with the `|` character between each character. Make it possible to execute function in this way: `'javascript'.pipefy()`. - [@code-answer](https://jsfiddle.net/thisman/6ynaf3ot/)
@@ -164,6 +165,28 @@ var b = function(obj, val) {
164165
}())
165166
```
166167

168+
Which one of the function expression below would be the best choice for the `prototype-constructor` pattern (a, b, c)? Why?
169+
```js
170+
function Man (name) {
171+
this.name = name;
172+
}
173+
174+
// a
175+
Man.prototype.getName = function () {
176+
return this.name;
177+
}
178+
179+
// b
180+
Man.prototype.getName = function getName() {
181+
return this.name;
182+
}
183+
184+
// c
185+
Man.prototype.getName = () => {
186+
return this.name;
187+
}
188+
```
189+
167190
## React interview questions
168191
1. What happens when you execute `setState()` in the `render()` method?
169192
1. What is the difference between 'smart and dummy' components?

0 commit comments

Comments
 (0)