JavaScript Operators


JavaScript Operators

  1. The expression of calling ( or executing ) a function or method in JavaScript is called ________











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    An invocation expression is JavaScript’s syntax for calling (or executing) a function or method) It starts with a function expression that identifies the function to be called.


  1. Consider the following statements.
    var t= "Example: 4, 5, 6"; // text
    var p = /\d+/g // Matches all instances of one or more digits

    In order to check if the pattern matches with the string “t”, the statement is











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The given pattern is applied on the text given in the parenthesis.



  1. The property of a primary expression is ____________











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The simplest expressions, known as primary expressions, are those that stand alone — they do not include any simpler expressions. Primary expressions in JavaScript are constant or literal values, certain language keywords, and variable references.


  1. A function definition expression can be called as __________











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    A function definition expression is a “function literal” in the same way that an object initializer is an “object literal.” A Function definition expression typically consists of the keyword function followed by a comma-separated list of zero or more identifiers (the parameter names) in parentheses and a block of JavaScript code (the function body) in curly braces.



  1. What will be the output of the following Javascript code?
    var str1 = ”4321”;
    var intval = 4321;
    alert( str1 + intval );











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In JavaScript the alert function does the type casting and converts the integer value to string. After that it concatenates both the strings and shows the result as a concatenated string. Thus 43214321 would be correct.