Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 1.65 KB

README.md

File metadata and controls

28 lines (19 loc) · 1.65 KB

Dynamic Type check in our javascript projects.

Well, I build this repository, because I consider it necessary to give my opinion based on my experience on how it is the best way to check data types in our projects using javascript. I think that JS is a great language that today is changing many ways of how to program, all this makes many programmers the lack of a static type checking system in variables at the time of compilation, causes in many people fear and uncertainty on how to handle certain aspects of an application.

There are basically two approaches, using "npm" modules or using the JS "typeof" native function.

Using some famous npm module and my own module:

Using only pure JS:

Go to the next link to see 3 differents techniques to handle type check using only js.

My custom parser type module:

Go to this link to see my last experiments, a function that decorate another function adding a type validation layer before run the function. The code use a special method of name the variables in a function.