Skip to content

Instantly share code, notes, and snippets.

@maimai-swap
Created May 9, 2012 09:56
Show Gist options
  • Save maimai-swap/2643466 to your computer and use it in GitHub Desktop.
Save maimai-swap/2643466 to your computer and use it in GitHub Desktop.
プロトタイプでclass作るときの自分のメモ
// tpsは自分の好きな名前なんでも。ルートのパッケージ名的な。
// geoは機能別に好きな名前なんでも。
if ( typeof(tps) == 'undefined' ) tps = {};
if ( typeof(tps.geo) == 'undefined' ) tps.geo = {};
tps.geo.prototype = {
prop01:false,
prop02:false,
init : function () {
this.func01();
},
func01 : function () {
console.log("func01");
}
}
/// USEAGE
// var tps_geo = tps.geo.prototype;
// tps_geo.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment