Skip to content
Advertisement

Tag: ecmascript-6

alternative approaches to multiple if else conditions [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question I have multiple conditions to be checked and executed like below. I think using switch statement doesn’t make sense here since

Group results of multiple POST API calls

I use the below script to loop through the input (skipping first one) to post some data to my API. Result How can I capture the combined response of both calls into a variable I can use later on in my script? something like var allNum = res.result.number[0]? This is what I want -> Var allTens = “002, 003” Script

ES6 Classes: Bind “this” to nested functions

I have multiple nested functions in a ES6 Class. Now I wonder how I can easily bind this of the class instance to all the subfunctions. I know of… …but it feels like an awkward solution for multiple nested functions. Does anyone know of a more elegant solution? Answer You can use arrow functions. They work in rather a similar

Advertisement