JS Questions April 18th

  1. What is promises in javascript.?
  2. what are the datatypes we use in javascript. And how we classify them…?
  3. What is the use of a type of operator?
1 Like

1.A promise takes in two functions as parameters. That is, resolve and reject . resolve is success, and reject is for when an error occurs
2.strings, numbers, booleans, undefined, and null
PRIMITIVE AND NON PRIMITIVE
Eg:
PRIMITIVE : numbers,boolean
Non PRIMITIVE: Objects, strings
3.for type checking and returns the data type of the operand passed to it

1 Like
  1. A promise is a JavaScript object that allows you to make asynchronous calls.
  2. strings, numbers, booleans, undefined, and null
    a. Primitive data type.
    b. Non-primitive (reference) data type.
  3. it is used for type checking and returns the data type of the operand passed to it
1 Like
  1. A promise is said to be settled if it is either fulfilled or rejected, but not pending.
    2.strings, numbers, Booleans, undefined, and null primitive and non primitive
    primitive: Boolean numbers,
    Non primitive: strings, Objects,
    3.checking and returns the data type of the operand passed to it
1 Like

1A.A Promise takes in two functions as parameters. They are resolve and reject. Resolving is success and Rejecting is for when an error occurs.
2A.Strings, numbers, booleans , undefined and null
i. Primitive Datatype
ii. Non-Primitive (reference) Datatype
3A. It is used for type checking and returns the Datatype of the operand passed to it.

1 Like

1ANS:- promises is proxy for a value not necessarily known when the promise is create.
2ANS:- primitive and nonprimitive
example :- strings, number, boolean, undefined, null
3ANS:- Comparison Operators are used to perform comparisons.

1 Like