Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Array = []
- Array.push({'test':'fuu','url':'sdfsdfsdf'});
- Array.push({'test':'qsgbfdsbgsdfbgsfdgb','url':'sdfssffbgsfdbgdfsdf'});
- if($.inArray('fuu',Array) != -1) alert('present');
- else alert('absent');
- alert($.inArray('fuu',Array));
- var arr = [];
- ...
- var found = false;
- $.each(arr, function () {
- if (this.test === 'fuu') {
- found = true;
- return false;
- }
- });
- if (found) alert('present');
- Array.push({'test':'fuu','url':'sdfsdfsdf'});
- $.inArray('fuu',Array)
- $.grep(Array, function(key) { return key.test == "fuu" }); // Object
Add Comment
Please, Sign In to add comment