2

In JS, you can find the typeof a JS primitive by console logging it with the 'typeof' keyword. Is there an equivalent keyword for immutable.js?

Gunther
  • 561
  • 8
  • 12
  • 1
    Possible duplicate of [How to check if object is Immutable?](https://stackoverflow.com/questions/31907470/how-to-check-if-object-is-immutable) – str Sep 06 '17 at 07:52
  • A pojo is only one type of JS primitive. This is not to test whether any of the primitives have been converted to an immutable; but rather what type of immutable it have been converted to. – Gunther Sep 06 '17 at 20:23

1 Answers1

1

You can use Immutable.Iterable.isIterable().

Please check this reference https://github.com/facebook/immutable-js/issues/450

An additional information :- Using ‘instanceof’ is a misleading function which leads developers to think in a wrong way, but it is not recommended because when you require different copies of Immutable.js then it may return False

Kushan Randima
  • 2,174
  • 5
  • 31
  • 58