Skip to content

Instantly share code, notes, and snippets.

@shaik2many
Created March 30, 2016 21:11
Show Gist options
  • Save shaik2many/51bba5be379a803f653f408a13ef719f to your computer and use it in GitHub Desktop.
Save shaik2many/51bba5be379a803f653f408a13ef719f to your computer and use it in GitHub Desktop.
<script>
var a = [
{ name:"string 1", value:"this", other: "that" },
{ name:"aijaz", value:"this", other: "that" },
{ name:"reyaz", value:"this", other: "that" }
];
var name = 'aijaz1';
var obj = a.filter(function ( obj ) {
return obj.name === name;
})[0];
console.log( obj );
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment