Skip to content
Advertisement

Promise D3 js inside ‘then’

Trying to understand the different steps to the Promise implementation for D3 js.

Have two input files and promise them all:

JavaScript

The array has been consolidated into one individual input, which might be called as a one-parameter function like:

JavaScript

Imagine I want to implement the second function as a two-parameter with the two inputs like function input(json, txt). What should happen in the then() statement to make the code do so?

Thanks

Advertisement

Answer

If you want to implement input function with two parameters:

JavaScript

then you can use rest parameters [more]:

JavaScript

or you can be more explicit:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement