var DummyDB = (function(){

var DummyDB = {};

var storage = [];

var count = 1;


DummyDB.get = function(id){

if(id){

id = (typeof id == 'string') ? Number(id):id;


for(var i in storage) if (storage[i].id == id){

return storage[i];

}

}

else{

return storage;

}

};


DummyDB.insert = function(data){

data.id = count++;

storage.push(data);

return data;

};


DummyDB.remove = function(id){

//변수 가공

id = (typeof id == 'string') ? Number(id) : id;


for(var i in storage) if (storage[i].id == id){

storage.splice(i, 1);


return true;

}


return false;

};


return DummyDB;

})();

'javascript' 카테고리의 다른 글

json stringify  (0) 2017.11.18
tableToExcel  (0) 2017.08.18
promise  (0) 2017.03.12
json data roop  (0) 2012.02.29
DOM  (0) 2012.02.17

1. nvm windows 설치


2. nvm install 버전 (node 설치)


3.nvm use 버전



'nodejs' 카테고리의 다른 글

미들웨어  (0) 2017.09.14
npm start  (0) 2017.09.13
express  (0) 2017.05.26
DummyDB  (0) 2017.05.26
nodemon  (0) 2017.02.27

.progress4 {

        position: relative;

        width: 100px;

        height: 100px;

    }

    

    .progress4:hover:after {

        background: #333;

        background: rgba(0,0,0,.8);

        border-radius: 5px;

        bottom: 26px;

        color: #fff;

        content: attr(data-tooltip);

        left: 20%;

        padding: 5px 15px;

        position: absolute;

        z-index: 98;

        width: 300px;

        white-space: pre-line;

        text-align:left;

        keep-all: break-all;

        margin-left: -250px; 

    }

    

    .progress4:hover:before {

        border: solid;

        border-color: #333 transparent;

        border-width: 6px 6px 0 6px;

        bottom: 20px;

        content: "";

        left: 50%;

        position: absolute;

        z-index: 99;

    }




<span style="color:#ffffff" data-html="true" class="progress3" 

data-tooltip="정상:

국가 전력수급 현황

- 500만KW 이상 ~ 50000만KW 이하

빌딩내 전력수급 현황

- 500KW 이상 ~ 50000KW 이하">정상</span>

+ Recent posts