JavaScript Boolean() method implementation

Took 1 minute and 3 seconds to code JavaScript Boolean() method. Here is the code snippet.

Code:

function boolean(condition) {
if (condition) {
return true;
} else {
return false;
}
}

document.write(boolean(0));

Result:

false

No comments:

Post a Comment

Coding for Kids

What is coding? In coding we build a program to do a specific task for us. Code: A code is a set of computer instructions and when you will ...