0

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
  • 2
    I haven't the slightest idea what he means. He probably means "Have you written any programs in Javascript?" Commented Dec 4, 2014 at 7:09

2 Answers 2

0

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
  • 1
    I would call the date pickers and sliders "widgets", personally. Widgets are components themelves but a rather small subset thereof. I generally agree with MainMa here, thoug components are modules and submodules and such. Commented Dec 4, 2014 at 7:55
3

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
  • This is it, just writing code that can be easily decoupled and reused. Instead of a spaghetti bowl of anonymous functions hard-coded to project specific selectors, you end up with nice reusable functions and prototypes that you can plop in anywhere. IOW, well-designed, not just built in place 'till it works and then gets no further love. Commented Dec 4, 2014 at 7:56

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.