Javascript object has own property

Check javascipt object property existance:

var obj = {yami: "code"};
function hasProperty(obj, property){
	if(obj.hasOwnProperty(property)){
    	return true;
	}
	return false;
}
hasProperty(obj, "yami"); //expected output: true
hasProperty(obj, "yamicode"); //expected output: false