Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (31 sloc) 1.1 KB
<DOCTYPE html/>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>uso operatori unari</title>
<script type="text/javascript">
var numero = 10;
</script>
</head>
<body>
<p id="paragrafo1">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p>paragrafo 2</p>
<pre>
<script type="text/javascript">
document.writeln( numero++ );//numero stampa 10 e dopo vale 11
document.writeln( numero-- );//numero stampa 11 e poi vale 10
document.writeln( numero );//numero vale 10
document.writeln( --numero );//numero vale 9 e stampa 9
document.writeln( ++numero );//numero vale 10 e stampa 10
document.writeln( numero );//numero vale 10
</script>
</pre>
</body>
</html>