Created
May 9, 2014 08:09
-
-
Save LESTADru/b94217f2a59d59b23c21 to your computer and use it in GitHub Desktop.
Функция отличающая переданный аргумент от undefined.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head lang="en"> | |
<meta charset="UTF-8"> | |
<title>в функции отличить отсутствующий аргумент от undefined</title> | |
</head> | |
<body> | |
<script> | |
'Use strict' | |
function f(x){ | |
alert( arguments.length == 0?0:1 ); | |
} | |
f(undefined); | |
f(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment