Changes while refactoring
- The "c" argument does not seem to be used. Removed it
- The contents of the loop through the parameters is self-contained and does not depend of aother parts of function. Also it provides a determined functional and calculates a concrete value. Moved it to a separate function getValueFormated.
- The "chunk" variable is defined without "var" keyword. Redefined
- The "text" variable is undefined. It seems, that author wanted to use "chunk". Replacing
- The "len" variable is defined without "var" keyword. It is not needed. Removed
- A condition in the cycle is "lower then or equals". It's incorrect for this case. Used "lower then"
- The "wrapperText" variable is not used. It consists the result of the transformation. So, I saved it to a "chunk" variable.
- The condition "chunk.length > 5" does not make any effect. Removed id
- this.domElement is undefined. Used document instead
- Is "ample" an external component? There is written in the taks that function has no dependencies...
- I don't think that name "calculatevalueandaddtohtmlobject" is optimal. It does not calculate values, it formats them. And this name is not well-readable. I changed the signature of the function and saved an old one for compatibility and marked it as deprecated.