Coder Social home page Coder Social logo

exercise-comscore-refactor's Introduction

Changes while refactoring

  1. The "c" argument does not seem to be used. Removed it
  2. 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.
  3. The "chunk" variable is defined without "var" keyword. Redefined
  4. The "text" variable is undefined. It seems, that author wanted to use "chunk". Replacing
  5. The "len" variable is defined without "var" keyword. It is not needed. Removed
  6. A condition in the cycle is "lower then or equals". It's incorrect for this case. Used "lower then"
  7. The "wrapperText" variable is not used. It consists the result of the transformation. So, I saved it to a "chunk" variable.
  8. The condition "chunk.length > 5" does not make any effect. Removed id
  9. this.domElement is undefined. Used document instead
  10. Is "ample" an external component? There is written in the taks that function has no dependencies...
  11. 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.

exercise-comscore-refactor's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.