FACTOID # 59: People might eat oats when they're hungry, but people from Hungary don't eat oats.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > Object literal

In Computer Science, a literal is a notation for representing a fixed value in source code, eg string literal. In contrast to this, variables or constants are symbols that can take on one of a class of fixed values, the constant being constrained not to change. Literals are often used to initialize variables, for example: Computer science, or computing science, is the study of the theoretical foundations of information and computation and their implementation and application in computer systems. ... Look up literal, literally in Wiktionary, the free dictionary. ... It has been suggested that value (programming) be merged into this article or section. ... A string literal is the representation of a string value within the source code of a computer program. ... In computer science and mathematics, a variable is a symbol denoting a quantity or symbolic representation. ... In mathematics and the mathematical sciences, a constant is a fixed, but possibly unspecified, value. ...

 int a=1; String s="cat"; 

Technically, a literal will be assigned a value at compile time, while a variable or constant will be assigned at runtime. In computer science, compile time, as opposed to runtime, is the time when a compiler compiles code written in a programming language into an executable form. ... In computer science, run time (with a space, though often its spelled without one) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). ...


In some object-oriented languages (like ECMAScript, but not C++), also objects can be represented by literals. Methods of this object can be specified in the object literal using function literals. The brace notation below, which is also used for array literals, is typical for object literals: In strictly mathematical branches of computer science the term object is used in a purely mathematical sense to refer to any thing. While this interpretation is useful in the discussion of abstract theory, it is not concrete enough to serve as a primitive datatype in the discussion of more concrete... ECMAScript is a scripting programming language, standardized by Ecma International in the ECMA-262 specification. ... It has been suggested that this article or section be merged into First-class function. ...

 {"cat","dog"} {name:"cat",length:57} 

In ECMAScript/JavaScript

In ECMAScript respectively its derivatives JavaScript and ActionScript an object with methods can be written using the object literal like this: ECMAScript is a scripting programming language, standardized by Ecma International in the ECMA-262 specification. ... JavaScript is the name of Netscape Communications Corporations and now the Mozilla Foundations implementation of the ECMAScript standard, a scripting language based on the concept of prototype-based programming. ... ActionScript is a scripting language based on ECMAScript, primarily used to develop software for the Adobe Flash . ...

 var newobj = { var1: true, var2: "very interesting", method1: function () { alert(this.var1) }, method2: function () { alert(this.var2) } } newobj.method1(); newobj.method2(); 

  Results from FactBites:
 
Object literal - Wikipedia, the free encyclopedia (159 words)
In Computer Science, a literal is an expression in source code which defines a fixed value.
Technically, a literal will be assigned a value at compile time, while a variable or constant will be assigned at runtime.
This concept is extended in object-oriented languages, although languages do not necessarily support representation of objects by literals.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.