New to Javascript - how to print value of "sam" outside the employee object
<html>
<head>
<script>
var employee = {
empname: "David",
department : "Finance",
id : 002,
details : function() {
this.empname = "Sam";
return this.empname + " with Department " + this.department;
}
};
document.write(employee.empname);
</script>
</head>
</html>
Thanks in Advance!!