victordobry
victordobry

Reputation: 3408

What is difference between Array.isArray and jQuery.isArray?

They seem to be the same.

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

Upvotes: 4

Views: 4402

Answers (2)

Alon Eitan
Alon Eitan

Reputation: 12025

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.

Upvotes: 9

Sagar V
Sagar V

Reputation: 12478

There is no difference.

jQuery just prototype the JavaScript's native isArray function.

something that will look like-

jQuery.prototype.isArray = Array.isArray;

Upvotes: 3

Related Questions