Data dodania Pytanie
2018-02-11 22:02 How does promise all guarantee return order in es6 »
I am using ES6 JavaScript and making API calls that are reliant on the order in which they are returned. The http client is Axios. A colleague has ins...
(1) odpowiedzi
2018-02-09 06:02 Correct use of arrow functions in React »
I am using ReactJS with Babel and Webpack and using ES6 as well as the proposed class fields for arrow functions. I understand that arrow functions ma...
(4) odpowiedzi
2018-02-08 20:02 Implement a SlideToggle Functionality with React.js »
I'd like to accomplish the following with my drop down menu. 1 - Show it upon click 2 -Hide it on second click 3 - Hide it when clicking anywhere o...
(2) odpowiedzi
2018-02-08 07:02 How to use import instead of require in node js »
I have following js file (non ES6 file): (Other questions on SO, are about importing a ES6 type module, but here I am looking for importing a non-ES6 ...
(1) odpowiedzi
2018-02-07 22:02 How to pass a class extending React.Component as a property to render it (using babel)? »
This issue is only reproducable in babel (using babel-runtime-6.26.0). Having the following structure class Foo extends React.Component { // ... } ...
(2) odpowiedzi
2018-02-06 08:02 javascript executed in the wrong order »
In Chrome console, it seems the 2nd line executes before the 1st line. Why? function fn(obj){ console.log(obj); obj.a = 1; } fn({b:1}); // p...
(3) odpowiedzi
2018-02-05 22:02 Loop through Nested Array of Objects, Rendering Different Markup »
I hit a rabbit hole with a React app. I'm looping through this array of objects: const weeklyClasses = [ { id: 1, day: "Monday", classD...
(1) odpowiedzi
2018-02-05 19:02 ES6 style classes in Parenscript »
Is there a decent way to write a Parenscript class macro that outputs ES6 class definitions? If the class definitions look like this: class Person {...
(2) odpowiedzi
2018-02-04 21:02 AngularJS & ES6: Service not logging as expected »
I'm unable to get my AngularJS services to function with ES6. This is super simplified but I still can't seem to get it to work! The code doesn't thr...
(1) odpowiedzi
2018-02-01 11:02 Is it worth idiomatic programming? An ES6 example »
Programming is about making decisions about how to implement any piece of code. Depending of such decisions, the code will be more or less readable, e...
(1) odpowiedzi
2018-01-27 22:01 How do these extra parameters work with map()? »
I'm working on better understanding functional programming in javascript, but I'm a bit confused by what I've seen fed to map functions. Take the exam...
(2) odpowiedzi
2018-01-24 23:01 Why is exporting/importing default ES module properties faster than names module properties? »
I'm reading the Material UI documentation, and it states: Notice that in the above example, we used: import RaisedButton from 'material-ui/Raise...
(1) odpowiedzi
2018-01-23 23:01 ES6 arrow function and lexical scope inside a function »
let a = () => ( { name:"Anna", func: () => console.log(this.name) } ) let b = () => ( { name:"Brian", func: function()...
(2) odpowiedzi
2018-01-23 05:01 Cannot find module '@angular-devkit/core' »
I have created a angular project with Angular CLI: 1.6.3 Node: 9.4.0 OS: linux x64 version. But when want to run my angular app with command ng serve...
(6) odpowiedzi
2018-01-21 15:01 What is a nice way to override the value a promise resolves to? »
I am writing a Node.js script to populate an SQL database with a test dataset. In the promise chain illustrated in the code snippet below (the real c...
(4) odpowiedzi
2018-01-19 11:01 destructure object only if it's truthy »
Suppose I want to destructure my function argument like this const func = ({field: {subField}}) => subField; How can I prevent this from throwi...
(3) odpowiedzi
2018-01-19 07:01 es6 arrow function in class property »
I bundle the codes with ./node_modules/.bin/webpack -d. I didn't compile ES6 to ES5 except this class fields proposal. It give this error: Uncaug...
(3) odpowiedzi
2018-01-19 07:01 React-redux connect() fails to pass the props »
I'm trying to learn react-redux architecture, and I failed on the most basic stuff. I created class HomePage and used react-redux connect() to connec...
(1) odpowiedzi
2018-01-18 11:01 get form value from nested children using react.js »
How to pass child's state back to the container? I have a very simple app but because I split them into smaller component now I'm stuck passing state ...
(2) odpowiedzi
2018-01-18 00:01 do the parens of a function call act like a grouping operator? »
do the parens of a function call act like a grouping operator ? 2 * (3 + 1) // 3 + 1 is evaluated first 'a'.concat('b'.concat('c')) // 'b'.concat('c...
(1) odpowiedzi
2018-01-17 21:01 Creating Object with variable as a key and value »
I am learning react and I am following the quick start guide, In the topic Lifting State Up I found the Calculator component class Calculator extends...
(2) odpowiedzi
2018-01-16 14:01 What is the most logical way to export React components? »
When writing React components in ES6, I sometimes wonder what the most logical way would be to export a component. I have found three ways to do so, a...
(5) odpowiedzi
2018-01-15 21:01 Can (a ==1 && a== 2 && a==3) ever evaluate to true? »
Is it ever possible that (a ==1 && a== 2 && a==3) could evaluate to true, in JavaScript? This is interview question asked by a major ...
(30) odpowiedzi
2018-01-14 23:01 Necessary to `import React from 'react'` when using styled-components? »
If I have a pure component that just takes some props and returns some jsx which is made up of components created 100% with styled-components, is it n...
(1) odpowiedzi
2018-01-13 16:01 Unusual syntax to create object method from a single item string array »
I come cross this redux-actions tutorial, and I noticed a unusual syntax to create an object method: const stringArray = ["STRING_ARRAY"]; const str...
(1) odpowiedzi
2018-01-11 01:01 javascript es6 module variable vs static »
Let's say we have these 2 classes, What are the differences of having a function in the module scope vs being a static class function, assuming doSome...
(2) odpowiedzi
2018-01-07 13:01 Destructuring assignment vs object property access in ES6 »
what is the difference between var bmw = cars.bmw and var {bmw} = cars ? Which way is better? var cars = { bmw: "M3", benz: "c250" } var bmw...
(1) odpowiedzi
2018-01-06 17:01 ES6 Promise wait for K out N promises to resolve »
var p1 = new Promise((resolve, reject) => { setTimeout(resolve, 1000, 'one'); }); var p2 = new Promise((resolve, reject) => { set...
(5) odpowiedzi
2018-01-05 10:01 map add/reduce two array object with same index »
I have two array object as following: var arr1 = [ { name: 1, value: 10 }, { name: 2, value: 15 } ] ...
(4) odpowiedzi
2018-01-04 23:01 How to import ES6 modules in content script for Chrome Extension »
In Chrome 61 there was added support for modules in JavaScript. Right now I am running Chrome 63. I am trying to figure out how to use import/export ...
(2) odpowiedzi
2018-01-04 16:01 Why are there differences between the node REPL and node script running when evaluating these expressions »
Why is there a difference between how Node REPL and the Node engine operating on a script interpret the following expression: {...a}? I'm running nod...
(1) odpowiedzi
2018-01-02 22:01 Javascript ES6 - Node Js - Associative Array - Objects use - wrong default order »
I have a problem trying to use associative arrays/objects in node, I have the following code and I want to get the same order I use when i inserted el...
(3) odpowiedzi
2017-12-31 02:12 Why does this comma inside a ternary operator throw a syntax error in JavaScript? »
I noticed something odd when trying to use the comma operator inside the conditional (ternary) operator for logging. Here's a contrived example: ...
(2) odpowiedzi
2017-12-29 21:12 Block-level variable redeclaration with var vs. let/const »
Part 1 Given this example: var number = 10 { var number = 42 } console.log(number) // 42 Why does line 4 not throw an Uncaught SyntaxError: Ide...
(2) odpowiedzi
2017-12-29 18:12 javascript es6: use case for destructuring rest parameter »
I just saw a code snippet in MDN about destructuring rest parameters like so: function f(...[a, b, c]) { return a + b + c; } f(1) // NaN ...
(2) odpowiedzi