class isBoolean { constructor(value) { this.value = value } assert() { if(typeof value === "string") { this.value = false } else if (typeof value === "undefined") { this.value = false } else if (typeof value === "object") { this.value = false } else if (typeof value === "number") { this.value = false } else if (typeof value === "symbol") { this.value = false } else if (typeof value === "function") { this.value = false } else { if(this.value === true || this.value === false) { this.value = true } else { this.value = false } } return this.value } } module.exports = isBoolean
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.
Discussion on: Challenge: Write your worst program
For further actions, you may consider blocking this person and/or reporting abuse