Tag Archives: Array

Middle Number in Array


Hi,I’m likhon.And today i’m going to show you.how to detect middle number in array

https://elikhon.wordpress.com/2015/07/02/middle-number-in-array/

Linux + C – Arrays as Pointers


We’ve dealt with arrays a little bit in the past. Did you know that that whole time, we were dealing with pointers? Array as a Pointer When we declare an array, we are really doing the following things: Allocating a section of memory large enough to contain N objects of the chosen data type Creating […]

https://rbfortcollins.wordpress.com/2015/08/26/linux-c-arrays-as-pointers/

loop through array in ES5


If you’re using an environment that supports the Array features of ES5 (directly or using a shim), you can use the new forEach function: var a = [“a”, “b”, “c”]; a.forEach(function(entry) { console.log(entry); }); forEach accepts an iterator function and, optionally, a value to use as this when calling that iterator function (not used above). The iterator function is called for each […]

https://vcfvct.wordpress.com/2015/08/05/loop-through-array-in-es5/

ECMAScript® 2015 Language Specification


Contents

  1. Introduction
  2. 1 Scope
  3. 2 Conformance
  4. 3 Normative references
  5. 4 Overview
    1. 4.1 Web Scripting
    2. 4.2 ECMAScript Overview
      1. 4.2.1 Objects
      2. 4.2.2 The Strict Variant of ECMAScript
    3. 4.3 Terms and definitions
      1. 4.3.1 type
      2. 4.3.2 primitive value
      3. 4.3.3 object
      4. 4.3.4 constructor
      5. 4.3.5 prototype
      6. 4.3.6 ordinary object
      7. 4.3.7 exotic object
      8. 4.3.8 standard object
      9. 4.3.9 built-in object
      10. 4.3.10 undefined value
      11. 4.3.11 Undefined type
      12. 4.3.12 null value
      13. 4.3.13 Null type
      14. 4.3.14 Boolean value
      15. 4.3.15 Boolean type
      16. 4.3.16 Boolean object
      17. 4.3.17 String value
      18. 4.3.18 String type
      19. 4.3.19 String object
      20. 4.3.20 Number value
      21. 4.3.21 Number type
      22. 4.3.22 Number object
      23. 4.3.23 Infinity
      24. 4.3.24 NaN
      25. 4.3.25 Symbol value
      26. 4.3.26 Symbol type
      27. 4.3.27 Symbol object
      28. 4.3.28 function
      29. 4.3.29 built-in function
      30. 4.3.30 property
      31. 4.3.31 method
      32. 4.3.32 built-in method
      33. 4.3.33 attribute
      34. 4.3.34 own property
      35. 4.3.35 inherited property
    4. 4.4 Organization of This Specification
  6. 5 Notational Conventions
    1. 5.1 Syntactic and Lexical Grammars
      1. 5.1.1 Context-Free Grammars
      2. 5.1.2 The Lexical and RegExp Grammars
      3. 5.1.3 The Numeric String Grammar
      4. 5.1.4 The Syntactic Grammar
      5. 5.1.5 Grammar Notation
    2. 5.2 Algorithm Conventions
    3. 5.3 Static Semantic Rules
  7. 6 ECMAScript Data Types and Values
    1. 6.1 ECMAScript Language Types
      1. 6.1.1 The Undefined Type
      2. 6.1.2 The Null Type
      3. 6.1.3 The Boolean Type
      4. 6.1.4 The String Type
      5. 6.1.5 The Symbol Type
      6. 6.1.6 The Number Type
      7. 6.1.7 The Object Type
    2. 6.2 ECMAScript Specification Types
      1. 6.2.1 The List and Record Specification Type
      2. 6.2.2 The Completion Record Specification Type
      3. 6.2.3 The Reference Specification Type
      4. 6.2.4 The Property Descriptor Specification Type
      5. 6.2.5 The Lexical Environment and Environment Record Specification Types
      6. 6.2.6 Data Blocks
  8. 7 Abstract Operations
    1. 7.1 Type Conversion
      1. 7.1.1 ToPrimitive ( input [, PreferredType] )
      2. 7.1.2 ToBoolean ( argument )
      3. 7.1.3 ToNumber ( argument )
      4. 7.1.4 ToInteger ( argument )
      5. 7.1.5 ToInt32 ( argument )
      6. 7.1.6 ToUint32 ( argument )
      7. 7.1.7 ToInt16 ( argument )
      8. 7.1.8 ToUint16 ( argument )
      9. 7.1.9 ToInt8 ( argument )
      10. 7.1.10 ToUint8 ( argument )
      11. 7.1.11 ToUint8Clamp ( argument )
      12. 7.1.12 ToString ( argument )
      13. 7.1.13 ToObject ( argument )
      14. 7.1.14 ToPropertyKey ( argument )
      15. 7.1.15 ToLength ( argument )
      16. 7.1.16 CanonicalNumericIndexString ( argument )
    2. 7.2 Testing and Comparison Operations
      1. 7.2.1 RequireObjectCoercible ( argument )
      2. 7.2.2 IsArray ( argument )
      3. 7.2.3 IsCallable ( argument )
      4. 7.2.4 IsConstructor ( argument )
      5. 7.2.5 IsExtensible (O)
      6. 7.2.6 IsInteger ( argument )
      7. 7.2.7 IsPropertyKey ( argument )
      8. 7.2.8 IsRegExp ( argument )
      9. 7.2.9 SameValue(x, y)
      10. 7.2.10 SameValueZero(x, y)
      11. 7.2.11 Abstract Relational Comparison
      12. 7.2.12 Abstract Equality Comparison
      13. 7.2.13 Strict Equality Comparison
    3. 7.3 Operations on Objects
      1. 7.3.1 Get (O, P)
      2. 7.3.2 GetV (V, P)
      3. 7.3.3 Set (O, P, V, Throw)
      4. 7.3.4 CreateDataProperty (O, P, V)
      5. 7.3.5 CreateMethodProperty (O, P, V)
      6. 7.3.6 CreateDataPropertyOrThrow (O, P, V)
      7. 7.3.7 DefinePropertyOrThrow (O, P, desc)
      8. 7.3.8 DeletePropertyOrThrow (O, P)
      9. 7.3.9 GetMethod (O, P)
      10. 7.3.10 HasProperty (O, P)
      11. 7.3.11 HasOwnProperty (O, P)
      12. 7.3.12 Call(F, V, [argumentsList])
      13. 7.3.13 Construct (F, [argumentsList], [newTarget])
      14. 7.3.14 SetIntegrityLevel (O, level)
      15. 7.3.15 TestIntegrityLevel (O, level)
      16. 7.3.16 CreateArrayFromList (elements)
      17. 7.3.17 CreateListFromArrayLike (obj [, elementTypes] )
      18. 7.3.18 Invoke(O,P, [argumentsList])
      19. 7.3.19 OrdinaryHasInstance (C, O)
      20. 7.3.20 SpeciesConstructor ( O, defaultConstructor )
      21. 7.3.21 EnumerableOwnNames (O)
      22. 7.3.22 GetFunctionRealm ( obj )
    4. 7.4 Operations on Iterator Objects
      1. 7.4.1 GetIterator ( obj, method )
      2. 7.4.2 IteratorNext ( iterator, value )
      3. 7.4.3 IteratorComplete ( iterResult )
      4. 7.4.4 IteratorValue ( iterResult )
      5. 7.4.5 IteratorStep ( iterator )
      6. 7.4.6 IteratorClose( iterator, completion )
      7. 7.4.7 CreateIterResultObject ( value, done )
      8. 7.4.8 CreateListIterator ( list )
  9. 8 Executable Code and Execution Contexts
    1. 8.1 Lexical Environments
      1. 8.1.1 Environment Records
      2. 8.1.2 Lexical Environment Operations
    2. 8.2 Code Realms
      1. 8.2.1 CreateRealm ( )
      2. 8.2.2 CreateIntrinsics ( realmRec )
      3. 8.2.3 SetRealmGlobalObject ( realmRec, globalObj )
      4. 8.2.4 SetDefaultGlobalBindings ( realmRec )
    3. 8.3 Execution Contexts
      1. 8.3.1 ResolveBinding ( name, [env] )
      2. 8.3.2 GetThisEnvironment ( )
      3. 8.3.3 ResolveThisBinding ( )
      4. 8.3.4 GetNewTarget ( )
      5. 8.3.5 GetGlobalObject ( )
    4. 8.4 Jobs and Job Queues
      1. 8.4.1 EnqueueJob (queueName, job, arguments)
      2. 8.4.2 NextJob result
    5. 8.5 ECMAScript Initialization()
      1. 8.5.1 InitializeHostDefinedRealm ( realm )
  10. 9 Ordinary and Exotic Objects Behaviours
    1. 9.1 Ordinary Object Internal Methods and Internal Slots
      1. 9.1.1 [[GetPrototypeOf]] ( )
      2. 9.1.2 [[SetPrototypeOf]] (V)
      3. 9.1.3 [[IsExtensible]] ( )
      4. 9.1.4 [[PreventExtensions]] ( )
      5. 9.1.5 [[GetOwnProperty]] (P)
      6. 9.1.6 [[DefineOwnProperty]] (P, Desc)
      7. 9.1.7 [[HasProperty]](P)
      8. 9.1.8 [[Get]] (P, Receiver)
      9. 9.1.9 [[Set]] ( P, V, Receiver)
      10. 9.1.10 [[Delete]] (P)
      11. 9.1.11 [[Enumerate]] ()
      12. 9.1.12 [[OwnPropertyKeys]] ( )
      13. 9.1.13 ObjectCreate(proto, internalSlotsList)
      14. 9.1.14 OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto, internalSlotsList )
      15. 9.1.15 GetPrototypeFromConstructor ( constructor, intrinsicDefaultProto )
    2. 9.2 ECMAScript Function Objects
      1. 9.2.1 [[Call]] ( thisArgument, argumentsList)
      2. 9.2.2 [[Construct]] ( argumentsList, newTarget)
      3. 9.2.3 FunctionAllocate (functionPrototype, strict [,functionKind] )
      4. 9.2.4 FunctionInitialize (F, kind, ParameterList, Body, Scope)
      5. 9.2.5 FunctionCreate (kind, ParameterList, Body, Scope, Strict, prototype)
      6. 9.2.6 GeneratorFunctionCreate (kind, ParameterList, Body, Scope, Strict)
      7. 9.2.7 AddRestrictedFunctionProperties ( F, realm )
      8. 9.2.8 MakeConstructor (F, writablePrototype, prototype)
      9. 9.2.9 MakeClassConstructor ( F)
      10. 9.2.10 MakeMethod ( F, homeObject)
      11. 9.2.11 SetFunctionName (F, name, prefix)
      12. 9.2.12 FunctionDeclarationInstantiation(func, argumentsList)
    3. 9.3 Built-in Function Objects
      1. 9.3.1 [[Call]] ( thisArgument, argumentsList)
      2. 9.3.2 [[Construct]] (argumentsList, newTarget)
      3. 9.3.3 CreateBuiltinFunction(realm, steps, prototype, internalSlotsList)
    4. 9.4 Built-in Exotic Object Internal Methods and Slots
      1. 9.4.1 Bound Function Exotic Objects
      2. 9.4.2 Array Exotic Objects
      3. 9.4.3 String Exotic Objects
      4. 9.4.4 Arguments Exotic Objects
      5. 9.4.5 Integer Indexed Exotic Objects
      6. 9.4.6 Module Namespace Exotic Objects
    5. 9.5 Proxy Object Internal Methods and Internal Slots
      1. 9.5.1 [[GetPrototypeOf]] ( )
      2. 9.5.2 [[SetPrototypeOf]] (V)
      3. 9.5.3 [[IsExtensible]] ( )
      4. 9.5.4 [[PreventExtensions]] ( )
      5. 9.5.5 [[GetOwnProperty]] (P)
      6. 9.5.6 [[DefineOwnProperty]] (P, Desc)
      7. 9.5.7 [[HasProperty]] (P)
      8. 9.5.8 [[Get]] (P, Receiver)
      9. 9.5.9 [[Set]] ( P, V, Receiver)
      10. 9.5.10 [[Delete]] (P)
      11. 9.5.11 [[Enumerate]] ()
      12. 9.5.12 [[OwnPropertyKeys]] ( )
      13. 9.5.13 [[Call]] (thisArgument, argumentsList)
      14. 9.5.14 [[Construct]] ( argumentsList, newTarget)
      15. 9.5.15 ProxyCreate(target, handler)
  11. 10 ECMAScript Language: Source Code
    1. 10.1 Source Text
      1. 10.1.1 Static Semantics: UTF16Encoding ( cp )
      2. 10.1.2 Static Semantics: UTF16Decode( lead, trail )
    2. 10.2 Types of Source Code
      1. 10.2.1 Strict Mode Code
      2. 10.2.2 Non-ECMAScript Functions
  12. 11 ECMAScript Language: Lexical Grammar
    1. 11.1 Unicode Format-Control Characters
    2. 11.2 White Space
    3. 11.3 Line Terminators
    4. 11.4 Comments
    5. 11.5 Tokens
    6. 11.6 Names and Keywords
      1. 11.6.1 Identifier Names
      2. 11.6.2 Reserved Words
    7. 11.7 Punctuators
    8. 11.8 Literals
      1. 11.8.1 Null Literals
      2. 11.8.2 Boolean Literals
      3. 11.8.3 Numeric Literals
      4. 11.8.4 String Literals
      5. 11.8.5 Regular Expression Literals
      6. 11.8.6 Template Literal Lexical Components
    9. 11.9 Automatic Semicolon Insertion
      1. 11.9.1 Rules of Automatic Semicolon Insertion
      2. 11.9.2 Examples of Automatic Semicolon Insertion
  13. 12 ECMAScript Language: Expressions
    1. 12.1 Identifiers
      1. 12.1.1 Static Semantics: Early Errors
      2. 12.1.2 Static Semantics: BoundNames
      3. 12.1.3 Static Semantics: IsValidSimpleAssignmentTarget
      4. 12.1.4 Static Semantics: StringValue
      5. 12.1.5 Runtime Semantics: BindingInitialization
      6. 12.1.6 Runtime Semantics: Evaluation
    2. 12.2 Primary Expression
      1. 12.2.1 Semantics
      2. 12.2.2 The this Keyword
      3. 12.2.3 Identifier Reference
      4. 12.2.4 Literals
      5. 12.2.5 Array Initializer
      6. 12.2.6 Object Initializer
      7. 12.2.7 Function Defining Expressions
      8. 12.2.8 Regular Expression Literals
      9. 12.2.9 Template Literals
      10. 12.2.10 The Grouping Operator
    3. 12.3 Left-Hand-Side Expressions
      1. 12.3.1 Static Semantics
      2. 12.3.2 Property Accessors
      3. 12.3.3 The new Operator
      4. 12.3.4 Function Calls
      5. 12.3.5 The super Keyword
      6. 12.3.6 Argument Lists
      7. 12.3.7 Tagged Templates
      8. 12.3.8 Meta Properties
    4. 12.4 Postfix Expressions
      1. 12.4.1 Static Semantics: Early Errors
      2. 12.4.2 Static Semantics: IsFunctionDefinition
      3. 12.4.3 Static Semantics: IsValidSimpleAssignmentTarget
      4. 12.4.4 Postfix Increment Operator
      5. 12.4.5 Postfix Decrement Operator
    5. 12.5 Unary Operators
      1. 12.5.1 Static Semantics: Early Errors
      2. 12.5.2 Static Semantics: IsFunctionDefinition
      3. 12.5.3 Static Semantics: IsValidSimpleAssignmentTarget
      4. 12.5.4 The delete Operator
      5. 12.5.5 The void Operator
      6. 12.5.6 The typeof Operator
      7. 12.5.7 Prefix Increment Operator
      8. 12.5.8 Prefix Decrement Operator
      9. 12.5.9 Unary + Operator
      10. 12.5.10 Unary - Operator
      11. 12.5.11 Bitwise NOT Operator ( ~ )
      12. 12.5.12 Logical NOT Operator ( ! )
    6. 12.6 Multiplicative Operators
      1. 12.6.1 Static Semantics: IsFunctionDefinition
      2. 12.6.2 Static Semantics: IsValidSimpleAssignmentTarget
      3. 12.6.3 Runtime Semantics: Evaluation
    7. 12.7 Additive Operators
      1. 12.7.1 Static Semantics: IsFunctionDefinition
      2. 12.7.2 Static Semantics: IsValidSimpleAssignmentTarget
      3. 12.7.3 The Addition operator ( + )
      4. 12.7.4 The Subtraction Operator ( - )
      5. 12.7.5 Applying the Additive Operators to Numbers
    8. 12.8 Bitwise Shift Operators
      1. 12.8.1 Static Semantics: IsFunctionDefinition
      2. 12.8.2 Static Semantics: IsValidSimpleAssignmentTarget
      3. 12.8.3 The Left Shift Operator ( << )
      4. 12.8.4 The Signed Right Shift Operator ( >> )
      5. 12.8.5 The Unsigned Right Shift Operator ( >>> )
    9. 12.9 Relational Operators
      1. 12.9.1 Static Semantics: IsFunctionDefinition
      2. 12.9.2 Static Semantics: IsValidSimpleAssignmentTarget
      3. 12.9.3 Runtime Semantics: Evaluation
      4. 12.9.4 Runtime Semantics: InstanceofOperator(O, C)
    10. 12.10 Equality Operators
      1. 12.10.1 Static Semantics: IsFunctionDefinition
      2. 12.10.2 Static Semantics: IsValidSimpleAssignmentTarget
      3. 12.10.3 Runtime Semantics: Evaluation
    11. 12.11 Binary Bitwise Operators
      1. 12.11.1 Static Semantics: IsFunctionDefinition
      2. 12.11.2 Static Semantics: IsValidSimpleAssignmentTarget
      3. 12.11.3 Runtime Semantics: Evaluation
    12. 12.12 Binary Logical Operators
      1. 12.12.1 Static Semantics: IsFunctionDefinition
      2. 12.12.2 Static Semantics: IsValidSimpleAssignmentTarget
      3. 12.12.3 Runtime Semantics: Evaluation
    13. 12.13 Conditional Operator ( ? : )
      1. 12.13.1 Static Semantics: IsFunctionDefinition
      2. 12.13.2 Static Semantics: IsValidSimpleAssignmentTarget
      3. 12.13.3 Runtime Semantics: Evaluation
    14. 12.14 Assignment Operators
      1. 12.14.1 Static Semantics: Early Errors
      2. 12.14.2 Static Semantics: IsFunctionDefinition
      3. 12.14.3 Static Semantics: IsValidSimpleAssignmentTarget
      4. 12.14.4 Runtime Semantics: Evaluation
      5. 12.14.5 Destructuring Assignment
    15. 12.15 Comma Operator ( , )
      1. 12.15.1 Static Semantics: IsFunctionDefinition
      2. 12.15.2 Static Semantics: IsValidSimpleAssignmentTarget
      3. 12.15.3 Runtime Semantics: Evaluation
  14. 13 ECMAScript Language: Statements and Declarations
    1. 13.1 Statement Semantics
      1. 13.1.1 Static Semantics: ContainsDuplicateLabels
      2. 13.1.2 Static Semantics: ContainsUndefinedBreakTarget
      3. 13.1.3 Static Semantics: ContainsUndefinedContinueTarget
      4. 13.1.4 Static Semantics: DeclarationPart
      5. 13.1.5 Static Semantics: VarDeclaredNames
      6. 13.1.6 Static Semantics: VarScopedDeclarations
      7. 13.1.7 Runtime Semantics: LabelledEvaluation
      8. 13.1.8 Runtime Semantics: Evaluation
    2. 13.2 Block
      1. 13.2.1 Static Semantics: Early Errors
      2. 13.2.2 Static Semantics: ContainsDuplicateLabels
      3. 13.2.3 Static Semantics: ContainsUndefinedBreakTarget
      4. 13.2.4 Static Semantics: ContainsUndefinedContinueTarget
      5. 13.2.5 Static Semantics: LexicallyDeclaredNames
      6. 13.2.6 Static Semantics: LexicallyScopedDeclarations
      7. 13.2.7 Static Semantics: TopLevelLexicallyDeclaredNames
      8. 13.2.8 Static Semantics: TopLevelLexicallyScopedDeclarations
      9. 13.2.9 Static Semantics: TopLevelVarDeclaredNames
      10. 13.2.10 Static Semantics: TopLevelVarScopedDeclarations
      11. 13.2.11 Static Semantics: VarDeclaredNames
      12. 13.2.12 Static Semantics: VarScopedDeclarations
      13. 13.2.13 Runtime Semantics: Evaluation
      14. 13.2.14 Runtime Semantics: BlockDeclarationInstantiation( code, env )
    3. 13.3 Declarations and the Variable Statement
      1. 13.3.1 Let and Const Declarations
      2. 13.3.2 Variable Statement
      3. 13.3.3 Destructuring Binding Patterns
    4. 13.4 Empty Statement
      1. 13.4.1 Runtime Semantics: Evaluation
    5. 13.5 Expression Statement
      1. 13.5.1 Runtime Semantics: Evaluation
    6. 13.6 The if Statement
      1. 13.6.1 Static Semantics: Early Errors
      2. 13.6.2 Static Semantics: ContainsDuplicateLabels
      3. 13.6.3 Static Semantics: ContainsUndefinedBreakTarget
      4. 13.6.4 Static Semantics: ContainsUndefinedContinueTarget
      5. 13.6.5 Static Semantics: VarDeclaredNames
      6. 13.6.6 Static Semantics: VarScopedDeclarations
      7. 13.6.7 Runtime Semantics: Evaluation
    7. 13.7 Iteration Statements
      1. 13.7.1 Semantics
      2. 13.7.2 The dowhile Statement
      3. 13.7.3 The while Statement
      4. 13.7.4 The for Statement
      5. 13.7.5 The forin and forof Statements
    8. 13.8 The continue Statement
      1. 13.8.1 Static Semantics: Early Errors
      2. 13.8.2 Static Semantics: ContainsUndefinedContinueTarget
      3. 13.8.3 Runtime Semantics: Evaluation
    9. 13.9 The break Statement
      1. 13.9.1 Static Semantics: Early Errors
      2. 13.9.2 Static Semantics: ContainsUndefinedBreakTarget
      3. 13.9.3 Runtime Semantics: Evaluation
    10. 13.10 The return Statement
      1. 13.10.1 Runtime Semantics: Evaluation
    11. 13.11 The with Statement
      1. 13.11.1 Static Semantics: Early Errors
      2. 13.11.2 Static Semantics: ContainsDuplicateLabels
      3. 13.11.3 Static Semantics: ContainsUndefinedBreakTarget
      4. 13.11.4 Static Semantics: ContainsUndefinedContinueTarget
      5. 13.11.5 Static Semantics: VarDeclaredNames
      6. 13.11.6 Static Semantics: VarScopedDeclarations
      7. 13.11.7 Runtime Semantics: Evaluation
    12. 13.12 The switch Statement
      1. 13.12.1 Static Semantics: Early Errors
      2. 13.12.2 Static Semantics: ContainsDuplicateLabels
      3. 13.12.3 Static Semantics: ContainsUndefinedBreakTarget
      4. 13.12.4 Static Semantics: ContainsUndefinedContinueTarget
      5. 13.12.5 Static Semantics: LexicallyDeclaredNames
      6. 13.12.6 Static Semantics: LexicallyScopedDeclarations
      7. 13.12.7 Static Semantics: VarDeclaredNames
      8. 13.12.8 Static Semantics: VarScopedDeclarations
      9. 13.12.9 Runtime Semantics: CaseBlockEvaluation
      10. 13.12.10 Runtime Semantics: CaseSelectorEvaluation
      11. 13.12.11 Runtime Semantics: Evaluation
    13. 13.13 Labelled Statements
      1. 13.13.1 Static Semantics: Early Errors
      2. 13.13.2 Static Semantics: ContainsDuplicateLabels
      3. 13.13.3 Static Semantics: ContainsUndefinedBreakTarget
      4. 13.13.4 Static Semantics: ContainsUndefinedContinueTarget
      5. 13.13.5 Static Semantics: IsLabelledFunction ( stmt )
      6. 13.13.6 Static Semantics: LexicallyDeclaredNames
      7. 13.13.7 Static Semantics: LexicallyScopedDeclarations
      8. 13.13.8 Static Semantics: TopLevelLexicallyDeclaredNames
      9. 13.13.9 Static Semantics: TopLevelLexicallyScopedDeclarations
      10. 13.13.10 Static Semantics: TopLevelVarDeclaredNames
      11. 13.13.11 Static Semantics: TopLevelVarScopedDeclarations
      12. 13.13.12 Static Semantics: VarDeclaredNames
      13. 13.13.13 Static Semantics: VarScopedDeclarations
      14. 13.13.14 Runtime Semantics: LabelledEvaluation
      15. 13.13.15 Runtime Semantics: Evaluation
    14. 13.14 The throw Statement
      1. 13.14.1 Runtime Semantics: Evaluation
    15. 13.15 The try Statement
      1. 13.15.1 Static Semantics: Early Errors
      2. 13.15.2 Static Semantics: ContainsDuplicateLabels
      3. 13.15.3 Static Semantics: ContainsUndefinedBreakTarget
      4. 13.15.4 Static Semantics: ContainsUndefinedContinueTarget
      5. 13.15.5 Static Semantics: VarDeclaredNames
      6. 13.15.6 Static Semantics: VarScopedDeclarations
      7. 13.15.7 Runtime Semantics: CatchClauseEvaluation
      8. 13.15.8 Runtime Semantics: Evaluation
    16. 13.16 The debugger statement
      1. 13.16.1 Runtime Semantics: Evaluation
  15. 14 ECMAScript Language: Functions and Classes
    1. 14.1 Function Definitions
      1. 14.1.1 Directive Prologues and the Use Strict Directive
      2. 14.1.2 Static Semantics: Early Errors
      3. 14.1.3 Static Semantics: BoundNames
      4. 14.1.4 Static Semantics: Contains
      5. 14.1.5 Static Semantics: ContainsExpression
      6. 14.1.6 Static Semantics: ExpectedArgumentCount
      7. 14.1.7 Static Semantics: HasInitializer
      8. 14.1.8 Static Semantics: HasName
      9. 14.1.9 Static Semantics: IsAnonymousFunctionDefinition ( production )
      10. 14.1.10 Static Semantics: IsConstantDeclaration
      11. 14.1.11 Static Semantics: IsFunctionDefinition
      12. 14.1.12 Static Semantics: IsSimpleParameterList
      13. 14.1.13 Static Semantics: LexicallyDeclaredNames
      14. 14.1.14 Static Semantics: LexicallyScopedDeclarations
      15. 14.1.15 Static Semantics: VarDeclaredNames
      16. 14.1.16 Static Semantics: VarScopedDeclarations
      17. 14.1.17 Runtime Semantics: EvaluateBody
      18. 14.1.18 Runtime Semantics: IteratorBindingInitialization
      19. 14.1.19 Runtime Semantics: InstantiateFunctionObject
      20. 14.1.20 Runtime Semantics: Evaluation
    2. 14.2 Arrow Function Definitions
      1. 14.2.1 Static Semantics: Early Errors
      2. 14.2.2 Static Semantics: BoundNames
      3. 14.2.3 Static Semantics: Contains
      4. 14.2.4 Static Semantics: ContainsExpression
      5. 14.2.5 Static Semantics: ExpectedArgumentCount
      6. 14.2.6 Static Semantics: HasInitializer
      7. 14.2.7 Static Semantics: HasName
      8. 14.2.8 Static Semantics: IsSimpleParameterList
      9. 14.2.9 Static Semantics: CoveredFormalsList
      10. 14.2.10 Static Semantics: LexicallyDeclaredNames
      11. 14.2.11 Static Semantics: LexicallyScopedDeclarations
      12. 14.2.12 Static Semantics: VarDeclaredNames
      13. 14.2.13 Static Semantics: VarScopedDeclarations
      14. 14.2.14 Runtime Semantics: IteratorBindingInitialization
      15. 14.2.15 Runtime Semantics: EvaluateBody
      16. 14.2.16 Runtime Semantics: Evaluation
    3. 14.3 Method Definitions
      1. 14.3.1 Static Semantics: Early Errors
      2. 14.3.2 Static Semantics: ComputedPropertyContains
      3. 14.3.3 Static Semantics: ExpectedArgumentCount
      4. 14.3.4 Static Semantics: HasComputedPropertyKey
      5. 14.3.5 Static Semantics: HasDirectSuper
      6. 14.3.6 Static Semantics: PropName
      7. 14.3.7 Static Semantics: SpecialMethod
      8. 14.3.8 Runtime Semantics: DefineMethod
      9. 14.3.9 Runtime Semantics: PropertyDefinitionEvaluation
    4. 14.4 Generator Function Definitions
      1. 14.4.1 Static Semantics: Early Errors
      2. 14.4.2 Static Semantics: BoundNames
      3. 14.4.3 Static Semantics: ComputedPropertyContains
      4. 14.4.4 Static Semantics: Contains
      5. 14.4.5 Static Semantics: HasComputedPropertyKey
      6. 14.4.6 Static Semantics: HasDirectSuper
      7. 14.4.7 Static Semantics: HasName
      8. 14.4.8 Static Semantics: IsConstantDeclaration
      9. 14.4.9 Static Semantics: IsFunctionDefinition
      10. 14.4.10 Static Semantics: PropName
      11. 14.4.11 Runtime Semantics: EvaluateBody
      12. 14.4.12 Runtime Semantics: InstantiateFunctionObject
      13. 14.4.13 Runtime Semantics: PropertyDefinitionEvaluation
      14. 14.4.14 Runtime Semantics: Evaluation
    5. 14.5 Class Definitions
      1. 14.5.1 Static Semantics: Early Errors
      2. 14.5.2 Static Semantics: BoundNames
      3. 14.5.3 Static Semantics: ConstructorMethod
      4. 14.5.4 Static Semantics: Contains
      5. 14.5.5 Static Semantics: ComputedPropertyContains
      6. 14.5.6 Static Semantics: HasName
      7. 14.5.7 Static Semantics: IsConstantDeclaration
      8. 14.5.8 Static Semantics: IsFunctionDefinition
      9. 14.5.9 Static Semantics: IsStatic
      10. 14.5.10 Static Semantics: NonConstructorMethodDefinitions
      11. 14.5.11 Static Semantics: PrototypePropertyNameList
      12. 14.5.12 Static Semantics: PropName
      13. 14.5.13 Static Semantics: StaticPropertyNameList
      14. 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
      15. 14.5.15 Runtime Semantics: BindingClassDeclarationEvaluation
      16. 14.5.16 Runtime Semantics: Evaluation
    6. 14.6 Tail Position Calls
      1. 14.6.1 Static Semantics: IsInTailPosition(nonterminal)
      2. 14.6.2 Static Semantics: HasProductionInTailPosition
      3. 14.6.3 Runtime Semantics: PrepareForTailCall ( )
  16. 15 ECMAScript Language: Scripts and Modules
    1. 15.1 Scripts
      1. 15.1.1 Static Semantics: Early Errors
      2. 15.1.2 Static Semantics: IsStrict
      3. 15.1.3 Static Semantics: LexicallyDeclaredNames
      4. 15.1.4 Static Semantics: LexicallyScopedDeclarations
      5. 15.1.5 Static Semantics: VarDeclaredNames
      6. 15.1.6 Static Semantics: VarScopedDeclarations
      7. 15.1.7 Runtime Semantics: ScriptEvaluation
      8. 15.1.8 Runtime Semantics: GlobalDeclarationInstantiation (script, env)
      9. 15.1.9 Runtime Semantics: ScriptEvaluationJob ( sourceText )
    2. 15.2 Modules
      1. 15.2.1 Module Semantics
      2. 15.2.2 Imports
      3. 15.2.3 Exports
  17. 16 Error Handling and Language Extensions
    1. 16.1 Forbidden Extensions
  18. 17 ECMAScript Standard Built-in Objects
  19. 18 The Global Object
    1. 18.1 Value Properties of the Global Object
      1. 18.1.1 Infinity
      2. 18.1.2 NaN
      3. 18.1.3 undefined
    2. 18.2 Function Properties of the Global Object
      1. 18.2.1 eval (x)
      2. 18.2.2 isFinite (number)
      3. 18.2.3 isNaN (number)
      4. 18.2.4 parseFloat (string)
      5. 18.2.5 parseInt (string , radix)
      6. 18.2.6 URI Handling Functions
    3. 18.3 Constructor Properties of the Global Object
      1. 18.3.1 Array ( . . . )
      2. 18.3.2 ArrayBuffer ( . . . )
      3. 18.3.3 Boolean ( . . . )
      4. 18.3.4 DataView ( . . . )
      5. 18.3.5 Date ( . . . )
      6. 18.3.6 Error ( . . . )
      7. 18.3.7 EvalError ( . . . )
      8. 18.3.8 Float32Array ( . . . )
      9. 18.3.9 Float64Array ( . . . )
      10. 18.3.10 Function ( . . . )
      11. 18.3.11 Int8Array ( . . . )
      12. 18.3.12 Int16Array ( . . . )
      13. 18.3.13 Int32Array ( . . . )
      14. 18.3.14 Map ( . . . )
      15. 18.3.15 Number ( . . . )
      16. 18.3.16 Object ( . . . )
      17. 18.3.17 Proxy ( . . . )
      18. 18.3.18 Promise ( . . . )
      19. 18.3.19 RangeError ( . . . )
      20. 18.3.20 ReferenceError ( . . . )
      21. 18.3.21 RegExp ( . . . )
      22. 18.3.22 Set ( . . . )
      23. 18.3.23 String ( . . . )
      24. 18.3.24 Symbol ( . . . )
      25. 18.3.25 SyntaxError ( . . . )
      26. 18.3.26 TypeError ( . . . )
      27. 18.3.27 Uint8Array ( . . . )
      28. 18.3.28 Uint8ClampedArray ( . . . )
      29. 18.3.29 Uint16Array ( . . . )
      30. 18.3.30 Uint32Array ( . . . )
      31. 18.3.31 URIError ( . . . )
      32. 18.3.32 WeakMap ( . . . )
      33. 18.3.33 WeakSet ( . . . )
    4. 18.4 Other Properties of the Global Object
      1. 18.4.1 JSON
      2. 18.4.2 Math
      3. 18.4.3 Reflect
  20. 19 Fundamental Objects
    1. 19.1 Object Objects
      1. 19.1.1 The Object Constructor
      2. 19.1.2 Properties of the Object Constructor
      3. 19.1.3 Properties of the Object Prototype Object
      4. 19.1.4 Properties of Object Instances
    2. 19.2 Function Objects
      1. 19.2.1 The Function Constructor
      2. 19.2.2 Properties of the Function Constructor
      3. 19.2.3 Properties of the Function Prototype Object
      4. 19.2.4 Function Instances
    3. 19.3 Boolean Objects
      1. 19.3.1 The Boolean Constructor
      2. 19.3.2 Properties of the Boolean Constructor
      3. 19.3.3 Properties of the Boolean Prototype Object
      4. 19.3.4 Properties of Boolean Instances
    4. 19.4 Symbol Objects
      1. 19.4.1 The Symbol Constructor
      2. 19.4.2 Properties of the Symbol Constructor
      3. 19.4.3 Properties of the Symbol Prototype Object
      4. 19.4.4 Properties of Symbol Instances
    5. 19.5 Error Objects
      1. 19.5.1 The Error Constructor
      2. 19.5.2 Properties of the Error Constructor
      3. 19.5.3 Properties of the Error Prototype Object
      4. 19.5.4 Properties of Error Instances
      5. 19.5.5 Native Error Types Used in This Standard
      6. 19.5.6 NativeError Object Structure
  21. 20 Numbers and Dates
    1. 20.1 Number Objects
      1. 20.1.1 The Number Constructor
      2. 20.1.2 Properties of the Number Constructor
      3. 20.1.3 Properties of the Number Prototype Object
      4. 20.1.4 Properties of Number Instances
    2. 20.2 The Math Object
      1. 20.2.1 Value Properties of the Math Object
      2. 20.2.2 Function Properties of the Math Object
    3. 20.3 Date Objects
      1. 20.3.1 Overview of Date Objects and Definitions of Abstract Operations
      2. 20.3.2 The Date Constructor
      3. 20.3.3 Properties of the Date Constructor
      4. 20.3.4 Properties of the Date Prototype Object
      5. 20.3.5 Properties of Date Instances
  22. 21 Text Processing
    1. 21.1 String Objects
      1. 21.1.1 The String Constructor
      2. 21.1.2 Properties of the String Constructor
      3. 21.1.3 Properties of the String Prototype Object
      4. 21.1.4 Properties of String Instances
      5. 21.1.5 String Iterator Objects
    2. 21.2 RegExp (Regular Expression) Objects
      1. 21.2.1 Patterns
      2. 21.2.2 Pattern Semantics
      3. 21.2.3 The RegExp Constructor
      4. 21.2.4 Properties of the RegExp Constructor
      5. 21.2.5 Properties of the RegExp Prototype Object
      6. 21.2.6 Properties of RegExp Instances
  23. 22 Indexed Collections
    1. 22.1 Array Objects
      1. 22.1.1 The Array Constructor
      2. 22.1.2 Properties of the Array Constructor
      3. 22.1.3 Properties of the Array Prototype Object
      4. 22.1.4 Properties of Array Instances
      5. 22.1.5 Array Iterator Objects
    2. 22.2 TypedArray Objects
      1. 22.2.1 The %TypedArray% Intrinsic Object
      2. 22.2.2 Properties of the %TypedArray% Intrinsic Object
      3. 22.2.3 Properties of the %TypedArrayPrototype% Object
      4. 22.2.4 The TypedArray Constructors
      5. 22.2.5 Properties of the TypedArray Constructors
      6. 22.2.6 Properties of TypedArray Prototype Objects
      7. 22.2.7 Properties of TypedArray Instances
  24. 23 Keyed Collection
    1. 23.1 Map Objects
      1. 23.1.1 The Map Constructor
      2. 23.1.2 Properties of the Map Constructor
      3. 23.1.3 Properties of the Map Prototype Object
      4. 23.1.4 Properties of Map Instances
      5. 23.1.5 Map Iterator Objects
    2. 23.2 Set Objects
      1. 23.2.1 The Set Constructor
      2. 23.2.2 Properties of the Set Constructor
      3. 23.2.3 Properties of the Set Prototype Object
      4. 23.2.4 Properties of Set Instances
      5. 23.2.5 Set Iterator Objects
    3. 23.3 WeakMap Objects
      1. 23.3.1 The WeakMap Constructor
      2. 23.3.2 Properties of the WeakMap Constructor
      3. 23.3.3 Properties of the WeakMap Prototype Object
      4. 23.3.4 Properties of WeakMap Instances
    4. 23.4 WeakSet Objects
      1. 23.4.1 The WeakSet Constructor
      2. 23.4.2 Properties of the WeakSet Constructor
      3. 23.4.3 Properties of the WeakSet Prototype Object
      4. 23.4.4 Properties of WeakSet Instances
  25. 24 Structured Data
    1. 24.1 ArrayBuffer Objects
      1. 24.1.1 Abstract Operations For ArrayBuffer Objects
      2. 24.1.2 The ArrayBuffer Constructor
      3. 24.1.3 Properties of the ArrayBuffer Constructor
      4. 24.1.4 Properties of the ArrayBuffer Prototype Object
      5. 24.1.5 Properties of the ArrayBuffer Instances
    2. 24.2 DataView Objects
      1. 24.2.1 Abstract Operations For DataView Objects
      2. 24.2.2 The DataView Constructor
      3. 24.2.3 Properties of the DataView Constructor
      4. 24.2.4 Properties of the DataView Prototype Object
      5. 24.2.5 Properties of DataView Instances
    3. 24.3 The JSON Object
      1. 24.3.1 JSON.parse ( text [ , reviver ] )
      2. 24.3.2 JSON.stringify ( value [ , replacer [ , space ] ] )
      3. 24.3.3 JSON [ @@toStringTag ]
  26. 25 Control Abstraction Objects
    1. 25.1 Iteration
      1. 25.1.1 Common Iteration Interfaces
      2. 25.1.2 The %IteratorPrototype% Object
    2. 25.2 GeneratorFunction Objects
      1. 25.2.1 The GeneratorFunction Constructor
      2. 25.2.2 Properties of the GeneratorFunction Constructor
      3. 25.2.3 Properties of the GeneratorFunction Prototype Object
      4. 25.2.4 GeneratorFunction Instances
    3. 25.3 Generator Objects
      1. 25.3.1 Properties of Generator Prototype
      2. 25.3.2 Properties of Generator Instances
      3. 25.3.3 Generator Abstract Operations
    4. 25.4 Promise Objects
      1. 25.4.1 Promise Abstract Operations
      2. 25.4.2 Promise Jobs
      3. 25.4.3 The Promise Constructor
      4. 25.4.4 Properties of the Promise Constructor
      5. 25.4.5 Properties of the Promise Prototype Object
      6. 25.4.6 Properties of Promise Instances
  27. 26 Reflection
    1. 26.1 The Reflect Object
      1. 26.1.1 Reflect.apply ( target, thisArgument, argumentsList )
      2. 26.1.2 Reflect.construct ( target, argumentsList [, newTarget] )
      3. 26.1.3 Reflect.defineProperty ( target, propertyKey, attributes )
      4. 26.1.4 Reflect.deleteProperty ( target, propertyKey )
      5. 26.1.5 Reflect.enumerate ( target )
      6. 26.1.6 Reflect.get ( target, propertyKey [ , receiver ])
      7. 26.1.7 Reflect.getOwnPropertyDescriptor ( target, propertyKey )
      8. 26.1.8 Reflect.getPrototypeOf ( target )
      9. 26.1.9 Reflect.has ( target, propertyKey )
      10. 26.1.10 Reflect.isExtensible (target)
      11. 26.1.11 Reflect.ownKeys ( target )
      12. 26.1.12 Reflect.preventExtensions ( target )
      13. 26.1.13 Reflect.set ( target, propertyKey, V [ , receiver ] )
      14. 26.1.14 Reflect.setPrototypeOf ( target, proto )
    2. 26.2 Proxy Objects
      1. 26.2.1 The Proxy Constructor
      2. 26.2.2 Properties of the Proxy Constructor
    3. 26.3 Module Namespace Objects
      1. 26.3.1 @@toStringTag
      2. 26.3.2 [ @@iterator ] ( )
  28. Annex A (informative) Grammar Summary
    1. A.1 Lexical Grammar
    2. A.2 Expressions
    3. A.3 Statements
    4. A.4 Functions and Classes
    5. A.5 Scripts and Modules
    6. A.6 Number Conversions
    7. A.7 Universal Resource Identifier Character Classes
    8. A.8 Regular Expressions
  29. Annex B (normative) Additional ECMAScript Features for Web Browsers
    1. B.1 Additional Syntax
      1. B.1.1 Numeric Literals
      2. B.1.2 String Literals
      3. B.1.3 HTML-like Comments
      4. B.1.4 Regular Expressions Patterns
    2. B.2 Additional Built-in Properties
      1. B.2.1 Additional Properties of the Global Object
      2. B.2.2 Additional Properties of the Object.prototype Object
      3. B.2.3 Additional Properties of the String.prototype Object
      4. B.2.4 Additional Properties of the Date.prototype Object
      5. B.2.5 Additional Properties of the RegExp.prototype Object
    3. B.3 Other Additional Features
      1. B.3.1 __proto__ Property Names in Object Initializers
      2. B.3.2 Labelled Function Declarations
      3. B.3.3 Block-Level Function Declarations Web Legacy Compatibility Semantics
      4. B.3.4 FunctionDeclarations in IfStatement Statement Clauses
      5. B.3.5 VariableStatements in Catch blocks
  30. Annex C (informative) The Strict Mode of ECMAScript
  31. Annex D (informative) Corrections and Clarifications in ECMAScript 2015 with Possible Compatibility Impact
  32. Annex E (informative) Additions and Changes That Introduce Incompatibilities with Prior Editions
  33. Bibliography

Preparing for ECMAScript 6: New Number Methods


via Preparing for ECMAScript 6: New Number Methods.

In this series about the new features of ECMAScript 6, we’ve discussed about new methods available for the String and Array data types, but also new types of data like Map and WeakMap.

In this article I’m going to introduce you to the new methods and constant added to the Number data type. Some of the methods covered, as we’ll see, aren’t new at all but they have been improved and/or moved under the right object (for example isNaN()). As always, we’ll also put the new knowledge acquired into action with some examples. So, without further ado, let’s start.

Subclassing builtins in ECMAScript 6


via Subclassing builtins in ECMAScript 6.

In JavaScript, it is difficult to create sub-constructors of built-in constructors such asArray. This blog post explains the problem and possible solutions – including one that will probably be chosen by ECMAScript 6. The post is based on Allen Wirfs-Brock’sslides from a presentation he held on January 29, during a TC39 meeting.

How to Find Missing Number in a Sorted Array in Java


via How to Find Missing Number in a Sorted Array in Java | Java67.

Today’s coding problem is not very new, it’s age old classic from programming interviews. You have a sorted array containing n – 1 unique numbers starting from 0 to n – 1. There is only one number missing in this range and you need to find that out. I mean you need to write a Java method to find the missing number and print it’s value in console. Some of you might have seen this question before, but if you have not been asked this question before, what is the first approach comes into your mind to solve this question? Since only one number is missing, many programmer come up with approach of iterating over array and comparing each element with the expected one e.g. first element should be 0, second element should be 1 and so on. Though this will sort the problem, it will costs you O(n) time. What can you do to improve performance? The key here is we have sorted array, do you think our earlier solution is taking full advantage of this knowledge, well it is but not fully. What it is doing is performing liner search which is costing O(n), but if you do binary search, which of course need a sorted array, we can reduce the time taken in the range of O(logN). Since numbers are in range from 0 to n – 1 and are sorted, the first number till the missing one should be same as their indexes. I mean if 0 is not missing, then it must be in the first index i.e. at 0. If you generalize this, you will find out that if the missing number is k then all numbers less than k are located in array with indexes same as their value. Also number k + 1 will be located at index k, and number k + 2 will be located at index k + 1. What does this mean? Well it means that missing number is the first cell whose value is not same as its index. So our problem reduces to search in an array to find the first cell, whose value is not same as its index. You can easily find out this by using binary search algorithmin O(logN) time. Our function implement this logic to find the missing integer in a sorted array in Java. You can use this solution to find missing number in array of numbers 1-1000 or 1 -100.