/ Published in: JavaScript
You can find a string as an array row value. Ex: arr=['abcde','mdleo'] arr.find('dbd') -> array['abcde'] arr.find('akdowewo') -> array[] (empty)
Expand |
Embed | Plain Text
// NEEDS MOOTOOLS 1.2 FRAMEWORK Array.prototype.find = function(searchStr) { var returnArray = []; this.each(function(objeto,index){ if (objeto.contains(searchStr)) { returnArray.push(objeto); alert('hay uno'); } }); return returnArray; }
You need to login to post a comment.
