Skip to content
Advertisement

Tag: ecmascript-6

Can console.log()s called from two different Worker threads ever step on each other, or are they always one after the other?

I have this small piece of example code: And: Run like so: node main.js The output is this: Sometimes several console.log()’s from one thread are called before any are called by the other. This is expected, and fine. But is there any chance that a console.log() could be called in the middle of another console.log()? So for example, could this

react JavaScript ternary conditional operation

After I import the data as json from the detail page, in ProductDetail > brand > shoes > size.length get the length length is outputting in JSX. But there is a problem. There are also products without shoes data for each detailed product on the detail page. I want to treat products without data as 0 instead of length as

How to log return value after async/await?

Below have I pasted in PoC code, where I have removed lots of lines, but it shows the problem/question I am facing. createPost() returns a “post number” in the ret variable. I don’t need the “post number for anything else than logging it. With the current implementation, I have to define ret outside of the while loop, and since sequential

Advertisement