K
K
Konstantin2020-11-20 18:00:58
css
Konstantin, 2020-11-20 18:00:58

How to sew enumerator?

There are several constants - document types const documentTypes = (10, 20, 40, 41, 78)

How best to protect them in the code so that you can create a color object based on them, as an example:

const documentColors = {
   10: "#ccc",
   20: "#000",
   ....
}


And also to be able to use in the code like:

if(documentTypes.10) {
}


I don't like the code above because it is not informative

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iBird Rose, 2016-09-16
@letehaha

Well, you can make it so that only a strip goes in the middle. without circles. and the circles are already done through before the elements themselves. then it will be possible to arrange the blocks not equidistantly, but as per the layout.
well, and adaptation is to compress the blocks to some pore, and then move them all in one direction, so that the strip is on the left, for example, and the blocks are on the right. if you make circles as described above, this will not break the structure.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question