Full Stack Developer | Freelancer | JavaScript | React | Nodejs. https://yogeshchavan.dev/. Book 1:1 @ hiretheauthor.com/myogeshchavan97
Full Stack Developer | Freelancer | JavaScript | React | Nodejs. Loves sharing knowledge through technical articles. Dev.to: https://dev.to/myogeshchavan97 https://linktr.ee/myogeshchavan97
Markdown supported · ⌘↵ to post
You can check your second parameter as below without 0 trap.
if (b != undefined) { // if b provided
return a * b;
}
Sasikumar Reddy Chevvu
Great Share 🚀, Thanks Yogesh