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

GITEX Dubai Talk by Saion Gupta and Saiasmi Gupta

Good morning, everyone. I'm Saion Gupta, the Founder of 10xCoderKids and the Guinness World Record holder for the youngest computer prog...