Determining the sign of a number is super easy now with ES6's Math.sign 👏 It will indicate whether the number is positive, negative or zero.
co...
For further actions, you may consider blocking this person and/or reporting abuse
slight error:
Math.signeither returns 1 or -1, so:did you perhaps mean
if (Math.sign(number) > 0)? in which caseif (number > 0)is more concise.OH good catch, let me fix it! Thanks for letting me know 😱
Its crazy to know, that even a positive / negative one line execution needs this much knowledge LoL
hahahaha 😂Tip of the iceberg...always more to know and more to learn when it comes to javascript 😆
Gotcha!
Laugh with sadness -- a perfect description of IE 😵
Thanks for the article! It’s always a good reminder that there’s probably a built in JavaScript method for pretty much anything you wanna do! :)
Totally! JS is a big toolbox and continues to add more tools for us to use, which is awesome. Thanks for reading my article 👏
+10 years with JavaScript and I never listen about negative 0! But make sense...
I only learned the negative 0 when i wrote this article. It will be interesting to see when i can actually apply it. I'll make sure to share when that happens 😊
Great content.
Thanks! Glad you liked the article 😄
Love your posts, Samantha, keep them coming
you bet! thanks for the encouragement benny 😊
you always find a good topic, thank you
thank you! i just pick topics that i want to learn, luckily this one resonates with you 😄And if there is a topic you want me to cover, please let me know! 👏
You learn something new everyday. Thanks for sharing!
I like that -- keep that student mindset so we can continue to learn and grow everyday! Thanks for reading 👏
Good to use !!