HTML and CSS Reference
In-Depth Information
* Sets the format of the media
* @param {String} format
*/
this.setFormat = function(format){
_format = format;
}
/**
* Gets the mime type of the media
* @return {String}
*/
this.getMime = function(){
return _mime;
}
/**
* Sets the mime type of the media
* @param {String} mime
*/
this.setMime = function(mime){
_mime = mime;
}
}
As you can see, there are just three instance variables called mime , format , and
name . With accessors, that's all that is required to create a new type. You can
create the release type in just the same way, by adding the following code to
releaseDate.js.
var app = app || {};
app.type = app.type || {};
/**
* The movie release date
* The constructor takes the cinema release date and dvd release date
* @param {Date} cinema
* @param {Date} dvd
*/
app.type.releaseDate = function(cinema, dvd){
/**
* The release date instance variables
*/
var _dvd,
_cinema;
/**
* Sets the instance variables using setters
 
Search WWH ::




Custom Search