Editing JavaScript 1 Einführung
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 564: | Line 564: | ||
<pre> | <pre> | ||
let cookieJar = ["Oreos", " Prinzenrolle", " Chocolate-Chip-Cookie", " Karamellkekse"]; | let cookieJar= ["Oreos", " Prinzenrolle", " Chocolate-Chip-Cookie", " Karamellkekse"]; | ||
function cookiesForAll() { | function cookiesForAll() { | ||
Line 609: | Line 609: | ||
In der Firma wurde eine neue Regel eingeführt, dass nur mehr "brave" MitarbeiterInnen Zugriff zur Keksdose haben, die anderen nicht .. 🤔 | In der Firma wurde eine neue Regel eingeführt, dass nur mehr "brave" MitarbeiterInnen Zugriff zur Keksdose haben, die anderen nicht .. 🤔 | ||
<pre> | <pre> | ||
let goodEmployee = true; | let goodEmployee= true; | ||
function goodOrBadEmployee() { | function goodOrBadEmployee() { | ||
if(goodEmployee){ | if(goodEmployee){ | ||
let cookieJar = ["Oreos", " Prinzenrolle", " Chocolate-Chip-Cookie", " Karamelkekse"]; | let cookieJar= ["Oreos", " Prinzenrolle", " Chocolate-Chip-Cookie", " Karamelkekse"]; | ||
console.log(`Innerhalb dieses IF-Blocks habe ich Zugriff auf die Keksdose, in ihr befinden sich ${cookieJar}`); | console.log(`Innerhalb dieses IF-Blocks habe ich Zugriff auf die Keksdose, in ihr befinden sich ${cookieJar}`); | ||
console.log(`Ich habe alle ${cookieJar.pop()} gegessen`); | console.log(`Ich habe alle ${cookieJar.pop()} gegessen`); |