4

They seem to be the same.

Internally jQuery just maps its own $.isArray to the native Array.isArray.*

8
  • stackoverflow.com/questions/22289727/… Commented Jul 19, 2017 at 6:37
  • Maybe it's a compatibility thing. Try checking previous revisions of this function Commented Jul 19, 2017 at 6:39
  • 1
    github.com/jquery/jquery/commit/… Commented Jul 19, 2017 at 6:46
  • @AlivetoDie Your link points to unrelated question. It seems to be similar, but it isn't. How it can help me? Commented Jul 19, 2017 at 11:38
  • @AlonEitan Probably. But why it isn't deprecated, if it just maps to a native function? Commented Jul 19, 2017 at 11:40

2 Answers 2

9

After further investigation I found this commit where they replaced jQuery.isArray with the native Array.isArray().

They also announced here that $.isArray is officially deprecated.

The function still exist for backward compatibility but I guess it will be dropped completly in a future jQuery release.

Sign up to request clarification or add additional context in comments.

Comments

3

There is no difference.

jQuery just prototype the JavaScript's native isArray function.

something that will look like-

jQuery.prototype.isArray = Array.isArray;

2 Comments

OP is in confusion and it is OP's assumption that both are same. This answer confirming it. @AlivetoDie
For what reason? If it would be for backward compatibility, it should be marked as deprecated, but it isn't.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.