Lets say I have this:
you might use default parameters in your function and then just pass the entire dataset itself, since the dataset is already a DOMStringMap Object
that way, you can deal with any data-values that got set in the html tag,
or use defaults if they weren't set - that kind of thing
maybe not in this situation, but in others, it might be advantageous to put all
your preferences in a single data-attribute
there are probably more terse ways of doing that, if you already know
certain things about the order of the data
- 热议问题