Kommentare zu: Konstanten in Javascript https://sgaul.de/2012/05/23/konstanten-in-javascript/ Neues aus den Softwareminen Thu, 13 Mar 2014 20:34:49 +0000 hourly 1 https://wordpress.org/?v=6.1.1 Von: Sebastian Gaul https://sgaul.de/2012/05/23/konstanten-in-javascript/#comment-418 Fri, 25 May 2012 10:03:56 +0000 https://sgaul.de/?p=1200#comment-418 Mit „Gehört das nicht zu den reservierten Wörtern… ?” meinst du, „dass es noch viele andere reservierte Wörter gibt, die aber teilweise noch gar keine Bedeutung/Verwendung haben…“? Ich geb’s auf 😉

]]>
Von: Georf https://sgaul.de/2012/05/23/konstanten-in-javascript/#comment-417 Fri, 25 May 2012 09:56:43 +0000 https://sgaul.de/?p=1200#comment-417 Ich wollte damit nur sagen, dass es noch viele andere reservierte Wörter gibt, die aber teilweise noch gar keine Bedeutung/Verwendung haben…

]]>
Von: Sebastian Gaul https://sgaul.de/2012/05/23/konstanten-in-javascript/#comment-415 Fri, 25 May 2012 09:01:40 +0000 https://sgaul.de/?p=1200#comment-415 Als Antwort auf Georf.

Aber ich verstehe nicht, worauf du hinaus willst. Meinst du, dass die da so ein Herstellerprefix verwenden sollten? -moz-const und so?

Jedenfalls voll irritierend, jetzt hintenrum noch Block-Scopes in JS einzuführen. Da hat man sich gerade so schön an den Funktionsmissbrauch gewöhnt…

]]>
Von: Georf https://sgaul.de/2012/05/23/konstanten-in-javascript/#comment-413 Thu, 24 May 2012 21:23:14 +0000 https://sgaul.de/?p=1200#comment-413

The current implementation of const is a Mozilla-specific extension and is not part of ECMAScript 5. It is supported in Firefox & Chrome (V8) and partially supported in Opera 9+ and Safari. It is not supported in Internet Explorer 6-9, or in the preview of Internet Explorer 10. The const keyword currently declares the constant in the function scope (like variables declared with var).

const is going to be defined by ECMAScript 6, but with different semantics. Similar to variables declared with the let statement, constants declared with const will be block-scoped.

]]>
Von: Sebastian Gaul https://sgaul.de/2012/05/23/konstanten-in-javascript/#comment-412 Thu, 24 May 2012 18:15:04 +0000 https://sgaul.de/?p=1200#comment-412 Als Antwort auf Georf.

Was ich meine: Konstanten sind ja bereits implementiert. Folglich muss const doch auch ein reserviertes Wort sein, oder nicht? Wäre sonst bestimmt schwierig rauszufinden, ob ein const nun eine Variable oder das Sprachfeature ist…

]]>
Von: Georf https://sgaul.de/2012/05/23/konstanten-in-javascript/#comment-409 Wed, 23 May 2012 21:59:53 +0000 https://sgaul.de/?p=1200#comment-409 Ich meinte zu den für die Zukunft vorgesehen Wörtern:

https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words

]]>
Von: Sebastian Gaul https://sgaul.de/2012/05/23/konstanten-in-javascript/#comment-408 Wed, 23 May 2012 20:29:07 +0000 https://sgaul.de/?p=1200#comment-408 Als Antwort auf Georf.

Ja bestimmt, wieso?

]]>
Von: Georf https://sgaul.de/2012/05/23/konstanten-in-javascript/#comment-407 Wed, 23 May 2012 20:28:01 +0000 https://sgaul.de/?p=1200#comment-407 Gehört das nicht zu den reservierten Wörtern… ?

]]>