As I promised in the past article (Click here if you want to read it), I’ll explain how you can use TypeLib JS to verify groups of data. But before, if you haven’t seen it… Project page: typelib.schemetastic.com As we learned in the past article, TypeLib makes data verification easy, for example, you can verify values such as NaN, Infinity and -Infinity. e.g. type(0/0).is; // "nan" type(1000/0).is; // "infinity" type(-1000/0).
In the previous part of this series I talked about how you can shorten your conditionals with truthy and falsy values. So if you haven’t read that one I would recommend that you do cause this is a continuation, Link here! In the past article I mentioned about string interpolation and how does the ternary operator becomes handy in these cases, however I knew that there was a lot more to say about it.