<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>041</title>
</head>
<body>
</body>
<script type="text/javascript">
(function () {
function Tune (song, aritst) {
var title = song;
this.concat = function(){
return title + " " + aritst;
}
}
var happySongs = [];
happySongs[0] = new Tune("Putting on the Ritz", "Ella Fitzgerald");
console.log(happySongs[0].title);
console.log(happySongs[0].concat());
happySongs[0].title = 'testing';
console.log(happySongs[0].title);
})();
(function () {
function Tune (song, aritst) {
var _title = song;
this.concat = function(){
return _title + " " + aritst;
}
}
var happySongs = [];
happySongs[0] = new Tune("Putting on the Ritz", "Ella Fitzgerald");
console.log(happySongs[0]._title);
console.log(happySongs[0].concat());
happySongs[0]._title = 'testing';
console.log(happySongs[0]._title);
})();
</script>
</html>