I have 4 dropdowns with the same code (below). As you can see they all share the same subfunction GetTitles. I would like to clean up the code and place that function once outside the others. What I can’t figure out is how to pass the correct value to VARIABLE , which is the name of a field key of a collection.
Ok, i could implement the new knowledge to my code. Very nice! Big THANKS!
For Edgar Sanchez a little example?
var REFERENCE1 = "referencefield-1"
var REFERENCE2 = "referencefield-2"
var REFERENCE3 = "referencefield-3"
var REFERENCE4 = "referencefield-4"
var REFERENCE5 = "referencefield-5"
var refFields = []
refFields.push(REFERENCE1, REFERENCE2, REFERENCE3, REFERENCE4, REFERENCE5)
@jonatandor35
Uffffff, i am honest, this .map-function is not really my best friend
But i will try to understand it. Perhaps in few months, i will know more about this .map-function and will be able to work with it.
At moment i have a hard time to work wiht .map
I just see very often, that you are using exactly this .map-function.
EDIT: And of course THANKS for all the good hints.
@jonatandor35
Yes for-each is more simply for me. But i also want to know the .map-function .
I will take a closer look on it soon. Perhaps i will come back with some questions again, when i start my analyses in relation to —> .map
P.S. Your tips give me the knowledge to code in a much more flexible way, i mean to use more variables and make the code more flexible and not static.
For example, creating flexible User-Interfaces.