我不知道我怎樣才能使它更多鈔票來擺脫把「新」功能之前的之前,例如:我怎麼能擺脫把「新」功能
new functionToDo("thingsToDo").iGotYouBruh("Halo Humans");
是有沒有「新」這樣做的可行方法?
這裏是我想不「新」,使用代碼:
function local (title) {
var storeTitle = title;
this.addL = function(lString) {
var storeText = lString;
localStorage.setItem(storeTitle, storeText);
console.info("Locally stored " + storeTitle.toUpperCase() + " with " + storeText.substring(0, 10) + "... As text.");
};
this.removeL = function() {
localStorage.removeItem(storeTitle);
console.info("Locally removed " + storeTitle + ".");
};
this.getL = function() {
localStorage.getItem(storeTitle);
console.info("Locally got string of " + storeTitle + ": " + localStorage.getItem(storeTitle));
};
};
和這裏就是我會做調用該函數:
new local("storedElement").getL();
我的意思是這真的是一個大交易? – 2015-02-07 00:56:38
我相信你指的是[Object.create()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create)? – 2015-02-07 00:57:23
@自己對我來說,現在它已經解決了,我會對答案進行一些研究並從中學習。 – 2015-02-07 00:58:01