Thanks for reading and taking the time to comment! What do you mean whether is correct or not?
You can run it on the console of your browser or using node. It should give you the expected outcome, if not please let me know.

Thanks for reading and taking the time to comment! What do you mean whether is correct or not?
You can run it on the console of your browser or using node. It should give you the expected outcome, if not please let me know.