Confirm the odd result of rounding a 5 down ( 0.7875 ). However, when we pass undefined, we will get NaN. The value undefined is assigned to formal arguments when there are no actual arguments, so you might expect that Number without arguments takes undefined as a value of its parameter. If we don't pass any arguments into the Number constructor, we'll get 0. You should watch very carefully for the above examples! The behaviour is described in section 7.2.15 Abstract Equality Comparison of the specification. -> is used to show the result of an expression. ⚠️ Note: If you enjoy reading this document, please, consider supporting the author of this collection. You're probably going to find something new. If you are a professional developer, you can consider these examples as a great reference for all of the quirks and unexpected edges of our beloved JavaScript. I hope these notes will motivate you to spend more time reading the specification. If you are a beginner, you can use these notes to get a deeper dive into JavaScript. Just because it's fun to learn something that we didn't know before. The primary goal of this list is to collect some crazy examples and explain how they work, if possible. “Just for Fun: The Story of an Accidental Revolutionary”, Linus Torvalds Non-strict comparison of a number to true.resolve() won't return Promise instance.Number.toFixed() display different numbers.Accessing object properties with arrays.Arrow functions can not be a constructor.document.all is an object, but it is undefined.true is not equal !, but not equal too. They may not contain every example, and existing examples may be outdated. Note: Translations are maintained by their translators. The source is available here: TranslationsĬurrently, there are these translations of wtfjs: Otherwise, you may continue reading on here. This will open the manual in your selected $PAGER. You should be able to run wtfjs at the command line now.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |