2
0

Polyfills.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. <h1>Polyfills</h1>
  11. <p class="desc">Three.js includes polyfills for the following functions and constants.</p>
  12. <h3>[page:Number.EPSILON Number.EPSILON]</h3>
  13. <p>
  14. The difference between one and the smallest value greater than one that can be represented as a Number.
  15. [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON MDN reference].
  16. </p>
  17. <h3>[page:Math.sign Math.sign]( [page:Number x] )</h3>
  18. <p>
  19. If the argument is a positive number, negative number, positive zero or negative zero,
  20. the function will return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned.
  21. [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign MDN reference].
  22. </p>
  23. <h3>[page:Function.prototype.name Function.prototype.name]( [page:Number x] )</h3>
  24. <p>
  25. Returns the name of a function, or (before ES6 implementations) an empty string for anonymous functions.
  26. [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name MDN reference].
  27. </p>
  28. <h3>[page:Object.assign Object.assign]( [page:Object target], [page:Object ...sources] )</h3>
  29. <p>
  30. The Object.assign() method is used to copy the values of all enumerable own properties from one or more source objects to a target object.
  31. It will return the target object.
  32. [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign MDN reference].
  33. </p>
  34. <h2>Source</h2>
  35. <p>
  36. [link:https://github.com/mrdoob/three.js/blob/master/src/polyfills.js src/polyfills.js]
  37. </p>
  38. </body>
  39. </html>