Hallo Leute... könnte mir einer erklären was genau der Befehl return var; in einer funktion bewirkt?
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
</head>
<body>
<script type="text/javascript">
var farben = new Array("green","white","blue","red","black","orange","yellow","darkgreen","lightgreen","pink");
function zufall10() {
var a= Math.round(farben.length*Math.random());
var b= farben[a];
return b;
}
var c= zufall10();
document.write("Die Farbe ist: " + c);
</script>
</body>
</html>