@@Rolf B
Wo ist das Farbtemplate „rot-grün kariert“, wenn man es braucht?
Du willst dir einen Kilt schneidern?
Für die Montage der Ausgabe ist der Template-String sicher eine gute Idee. Aber die \n sind es nicht. Es sei denn, du WILLST eine Ausgabe mit doppeltem Zeilenabstand.
Will ich nicht. Hast recht, die \n
sollten weg.
Solche Ausbrüche aus der Einrückung mag ich persönlich gar nicht leiden. In PHP kann man das in Heredoc-Strings durch passendes Platzieren des END Symbols lösen, in JS leider nicht. Deswegen würde ich lieber für jede Zeile einen eigenen Template-String verwenden.
Nööö!
Es spricht nichts gegen Einrückungen (guckst du):
function analyzeImage(bild) {
document.querySelector('output').textContent =
`Höhe: ${bild.height}px
Breite: ${bild.width}px
orig. Höhe: ${bild.naturalHeight}px
orig. Breite: ${bild.naturalWidth}px`;
}
🖖 Live long and prosper
--
“In my home, the America I love, the America I've written about, that has been a beacon of hope and liberty for 250 years, is currently in the hands of a corrupt, incompetent and treasonous administration. Tonight, we ask all who believe in democracy and the best of our American spirit, to rise with us, raise your voices against authoritarianism, and let freedom reign.”
— Bruce Springsteen, Manchester 2025-05-14
“In my home, the America I love, the America I've written about, that has been a beacon of hope and liberty for 250 years, is currently in the hands of a corrupt, incompetent and treasonous administration. Tonight, we ask all who believe in democracy and the best of our American spirit, to rise with us, raise your voices against authoritarianism, and let freedom reign.”
— Bruce Springsteen, Manchester 2025-05-14