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
var x = 1; | |
var x = 1 + 1; |
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
var x = 1; // x ist 1 | |
x += 2; // x ist 3 | |
x -= 1; // x ist 2 | |
x *= 5; // x ist 10 | |
x /= 2; // x ist 5 |
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
var i = 1; | |
var j = 2; | |
if (i < j) { | |
// true; | |
} | |
if (i > j) { | |
// false; | |
} |
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
var meinWert = 1; | |
meinWert++; // meinWert ist nun 2 | |
meinWert--; // meinWert ist nun wieder 1 |
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
var a = 3; | |
var b = 4; | |
var c = 5; | |
var d = 6; | |
// beide bedingungen müssen zutreffen. gelesen: | |
// - Wenn a kleiner als b UND c kleiner als d... | |
if (a < b && c < d) { | |
// trifft zu | |
} |
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
/* | |
Block Kommentar | |
in mehreren Zeilen | |
Java, C, C++, Objective-C, PHP, ... | |
*/ | |
// Kommentar in einer einzelnen Zeile, sehr weit verbereitet | |
# In manchen Sprachen kann ein Kommentar mit dem "#" Zeichen beginnen |
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
// Basisvergleich | |
var alter = 18; | |
if (alter < 18) { | |
document.write("Noch nicht volljährig, unter 18!<br>"); | |
} else { | |
document.write("Volljährig! 18 oder älter!<br>"); | |
} |
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
for ( var i = 1; i <= 5; i++ ) { | |
document.write(i); | |
} |
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
var i = 1; | |
while (i <= 5) { | |
document.write(i); | |
i++; | |
} |
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
// (schleifenzaehler; bedingung; inkrement) | |
for (int i = 0; i < farben.length; i++) { | |
System.out.println(farben[i]); | |
} |
OlderNewer