esercizi js
This commit is contained in:
62
js3.html
Normal file
62
js3.html
Normal file
@@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script>
|
||||
var a = 5;
|
||||
|
||||
function f(){return a;}
|
||||
|
||||
document.writeln(f());
|
||||
|
||||
var a = 10;
|
||||
|
||||
document.writeln(f());
|
||||
|
||||
|
||||
|
||||
|
||||
oggetto = {
|
||||
nome:"n",
|
||||
cognome:"c"
|
||||
}
|
||||
|
||||
if ("nome" in oggetto)
|
||||
document.writeln(oggetto.nome);
|
||||
|
||||
|
||||
f2.counter=0;
|
||||
function f2(){
|
||||
document.writeln(arguments.length);
|
||||
document.writeln(arguments.callee.length);
|
||||
document.writeln(arguments.callee.counter);
|
||||
document.writeln(f2.counter);
|
||||
|
||||
if (f2.counter < 100){
|
||||
f2.counter++;
|
||||
document.writeln("recursive " + f2.counter);
|
||||
f2();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
f2("a","b","c","d");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user