Created
January 25, 2015 10:57
-
-
Save luckyduck/8022a1e802d7d46ff356 to your computer and use it in GitHub Desktop.
Variablenübung
This file contains hidden or 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> | |
<meta charset="UTF-8"> | |
<title>Grundlagen der Programmierung - Datentypen</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
// 1. Variablen deklarieren und initialisieren | |
var integerWert = 20; | |
var floatWert = 5.0; | |
var ergebnis = integerWert / floatWert; | |
// 2. Variablen in einem Array speichern | |
var berechnung = {a: integerWert, b: floatWert, c: ergebnis}; | |
// 3. Ausgabe | |
document.write(berechnung['a'] + " / " + berechnung['b'] + " = " + berechnung['c']); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment