NEWS
JSON Daten auslesen
-
Da war selfHTML (Quelle) wohl etwas lax. `
Ja. https://molily.de/js/variablen.html#bezeichner. -
Sehe schon Code wie „ein[emoji813]FürTiere“ vor mir. Wäre lustig mit Emoticons … [emoji12]
-
Sehe schon Code wie „ein[emoji813]FürTiere“ vor mir. Wäre lustig mit Emoticons … [emoji12] `
Auch wenn es in JSON nicht erlaubt ist, als Variablenname geht sowas… (bitte nicht!)
https://mathiasbynens.be/notes/javascript-identifiers
The following are all examples of valid JavaScript variable names. // How convenient! var π = Math.PI; // Sometimes, you just have to use the Bad Parts of JavaScript: var ಠ_ಠ = eval; // Code, Y U NO WORK?! var ლ_ಠ益ಠ_ლ = 42; // How about a JavaScript library for functional programming? var λ = function() {}; // Obfuscate boring variable names for great justice var \u006C\u006F\u006C\u0077\u0061\u0074 = 'heh'; // …or just make up random ones var Ꙭൽↈⴱ = 'huh'; // While perfectly valid, this doesn’t work in most browsers: var foo\u200Cbar = 42; // This is *not* a bitwise left shift (`<<`): var 〱〱 = 2; // This is, though: 〱〱 << 〱〱; // 8 // Give yourself a discount: var price_9̶9̶_89 = 'cheap'; // Fun with Roman numerals var Ⅳ = 4; var Ⅴ = 5; Ⅳ + Ⅴ; // 9 // Cthulhu was here var Hͫ̆̒̐ͣ̊̄ͯ͗͏̵̗̻̰̠̬͝ͅE̴̷̬͎̱̘͇͍̾ͦ͊͒͊̓̓̐_̫̠̱̩̭̤͈̑̎̋ͮͩ̒͑̾͋͘Ç̳͕̯̭̱̲̣̠̜͋̍O̴̦̗̯̹̼ͭ̐ͨ̊̈͘͠M̶̝̠̭̭̤̻͓͑̓̊ͣͤ̎͟͠E̢̞̮̹͍̞̳̣ͣͪ͐̈T̡̯̳̭̜̠͕͌̈́̽̿ͤ̿̅̑Ḧ̱̱̺̰̳̹̘̰́̏ͪ̂̽͂̀͠ = 'Zalgo'; -
Wenn alle Unicode-Buchstaben erlaubt sind warum klappt es dann mit dem - beim Objekt-Property nicht? - ist kein Buchstabe? Liegt’s am JSON.parse()?
-
- ist kein Buchstabe? `
Richtig. - ist ein unerlaubtes Sonderzeichen.
- ist kein Buchstabe? `
-
Wenn alle Unicode-Buchstaben erlaubt sind warum klappt es dann mit dem - beim Objekt-Property nicht? - ist kein Buchstabe? Liegt’s am JSON.parse()? `
- ist ein Minus.
Wäre es erlaubt, könnte JS nicht wissen, ob du mit - einen Teil der Eigenschaft meinst oder subtrahieren willst:
obj.lange-eigenschaft; // (obj.lange minus eigenschaft) oder (ist eigenschaft Teil des Namens)? -
Super Erklärung für Ingo1977. Hoffentlich liest er noch mit ;-)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login