Javascript is a dynamically typed language, so a variable can contain anything. The more important it is to have working type checks. Here is a list of functions I am using. I was happy to get some additions/corrections on this:
isArr = Array.isArray isEle = (c) => c instanceof Element isNode = (c) => c instanceof Node isStr = (s) => typeof s === 'string' isObj = (c) => typeof c === 'object' && !isArr(c) && c !== null isDef = (c) => typeof c !== "undefined"; isNum = (c) => typeof c === "number"; isFnc = (c) => typeof c === "function"; isEmpty = (s) => s.length === 0 isBlank = (s) => s.trim().length === 0
@efpage Thankyou for update
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Javascript is a dynamically typed language, so a variable can contain anything. The more important it is to have working type checks. Here is a list of functions I am using. I was happy to get some additions/corrections on this:
@efpage Thankyou for update