I was recently asked by a recruiter if i knew component development with javascript. Since i was hearing this for the first time, i said i had no idea regarding it. I google it and got very few results which did not clear the exact meaning.
So what is component development mean with regard to javascript? Is it a new concept? Is it like creating plugins? Any pointers or examples would be really helpful
1
The idea behind components is to make reusable pieces of code similar to plugins, like Date Pickers, Sliders and so on. They are similar as functionality, but the difference is that there is a common ground to make the integration easier. Just like jQuery plugin platform, but you don’t depend on jQuery. In fact, every component can require different versions of jQuery. Yes, you’ve guessed it already, jQuery is a component too.
Here is the GitHub page where you can find these components: https://github.com/component
There is also a registry for them for easier retrieval: https://www.npmjs.org/package/component
1
I would imagine that he was asking whether you’re able to separate an application into components. The opposite would be a monolithic JavaScript app—frequent case in JavaScript world (with a small script growing over time).
The answer then could:
-
Explain the benefits of components (better architecture, ability to reason in terms of interfaces, ability to work on one part without having to deal with others and reduced global scope pollution),
-
Quote the commonly used JavaScript’s module pattern, as well as require.js.
If you’re interviewed for a position where you’re expected to know node.js as well, you could also mention packages and npm
. If not, mention them anyway.
1