By Oleksii Rudenko November 1, 2015 9:00 PM
Best Web Development Answers on StackOverflow - October, 2015

We selected 4 Stack Overflow best answers of October, 2015 that are related to Web Development.

Why use Redux over Facebook Flux?

Asked by Volodymyr Bakhmatiuk. The best answer (76 votes) by the author of Redux:

Redux is not that different from Flux. Overall it's the same architecture, but Redux is able to cut some complexity corners by using functional composition where Flux uses callback registration.

says [Dan Abramov](

To summarize, Redux is better at helping to deal with some use cases such as re-using functionality across stores, server rendering and hot reloading. Not a Redux/Flux expert here, so read the full answer if you are interested in this topic:

What is var { comma, separated, list } = name; in JavaScript? [duplicate]

GreenAsJade asked what this means:

var React = require('react-native');
var {
} = React;

As the best answer(70 votes) points out, it’s an ES6 destructing assignment and the aforementioned snippet is equivalent to this ES5 piece of code:

var AppRegistry = React.AppRegistry;
var StyleSheet = React.StyleSheet;
var Text = React.Text;
var View = React.View;

This question has been already raised several times on StackOverflow. Yet it seems that many JavaScripters are not very familiar with the new ECMAScript standard. If it’s still new to you, I suggest taking a look at this overview of ES6 features: ES6 Overview in 350 Bullet Points

Difference between val.length and val().length in jQuery?

Mayank Vadiya is wondering why $("#id").val.length !== $("#id").val().length.

The best answer by Tushar (44 votes) points out that $("#id").val is a function and the length of a function (i.e. $("#id").val.length) equals the number of function arguments. So $("#id").val.length will return 1. On the contrary, $("#id").val().length is the length of the value that the val function returns.

What is the context of “this” in this example?

Sheida asks what this in inline event handlers is:

<p id= "p2" onclick="alert(this)"> a paragraph </p>

The best answer with 28 votes is:

In inline JavaScript events, this is the element that the event was triggered on. These are both onclick events, so this is the element you clicked on.

says [Rocket Hazmat](

That’s good to know. How often do you still define event handlers inline?

We hope we all learned something new from these answers. Thanks for reading and till the next time!