Title: WP-UI breaks Array.indexOf
Last modified: August 20, 2016

---

# WP-UI breaks Array.indexOf

 *  [briankuhn](https://wordpress.org/support/users/briankuhn/)
 * (@briankuhn)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/wp-ui-breaks-arrayindexof/)
 * WP-UI is monkey patching Array.indexOf with a bad/invalid implementation.
 * [http://plugins.trac.wordpress.org/browser/wp-ui/trunk/js/wp-ui-dev.js#L1109](http://plugins.trac.wordpress.org/browser/wp-ui/trunk/js/wp-ui-dev.js#L1109)
 * This breaks other scripts! At the very least, this implementation should return-
   1 when a match is not found, not undefined. But if you’re going to monkey patch,
   do it right. Mozilla provides a fully standards-compliant implementation here:
 * [https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/indexOf#Compatibility](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/indexOf#Compatibility)
 * [http://wordpress.org/extend/plugins/wp-ui/](http://wordpress.org/extend/plugins/wp-ui/)

The topic ‘WP-UI breaks Array.indexOf’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-ui_dda563.svg)
 * [WP UI - Tabs, Accordions, Sliders](https://wordpress.org/plugins/wp-ui/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-ui/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-ui/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-ui/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-ui/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-ui/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [briankuhn](https://wordpress.org/support/users/briankuhn/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/wp-ui-breaks-arrayindexof/)
 * Status: not resolved