divyagnan/hnt

Helper functions

Opened this issue · 0 comments

hnt is useful but sometimes you want to do things other than just access a value.

For example you may want to get a value and if that value is a certain number to greater than a certain number you may want to do something. In other words you might want to use hnt for equality checks:

import { eql } from "hnt";

// first two params are the same as hnt, last param is what value should be checked
// if deepArray[0][0][0] === 0 then eql will return true, 
// otherwise (if it is undefined or equals something else) it will return false
eql(deepArray, "[0][0][0]", 0);