PageRenderTime 55ms CodeModel.GetById 28ms RepoModel.GetById 1ms app.codeStats 0ms

/website/source/php/var/is_null.html

http://github.com/kvz/phpjs
HTML | 41 lines | 40 code | 1 blank | 0 comment | 0 complexity | 417674c19983d0657ac6ba63424f62c0 MD5 | raw file
  1. ---
  2. warning: 'This file is auto generated by `npm run web:inject`, do not edit by hand'
  3. examples:
  4. - is_null('23')
  5. - is_null(null)
  6. returns:
  7. - 'false'
  8. - 'true'
  9. dependencies: []
  10. authors:
  11. original by:
  12. - 'Kevin van Zonneveld (https://kvz.io)'
  13. notes: []
  14. type: function
  15. layout: function
  16. title: PHP's is_null in JavaScript
  17. description: >-
  18. Heres what our current JavaScript equivalent to <a
  19. href="https://php.net/manual/en/function.is-null.php">PHP's is_null</a> looks
  20. like.
  21. function: is_null
  22. category: var
  23. language: php
  24. permalink: php/var/is_null/
  25. alias:
  26. - /functions/php/is_null/
  27. - /functions/var/is_null/
  28. - /php/is_null/
  29. - /functions/is_null/
  30. ---
  31. {% codeblock lang:javascript %}module.exports = function is_null (mixedVar) { // eslint-disable-line camelcase
  32. // discuss at: https://locutus.io/php/is_null/
  33. // original by: Kevin van Zonneveld (https://kvz.io)
  34. // example 1: is_null('23')
  35. // returns 1: false
  36. // example 2: is_null(null)
  37. // returns 2: true
  38. return (mixedVar === null)
  39. }
  40. {% endcodeblock %}