Posted 2007/03/21 18:05 Filed under 01010101 자바스크립트에서 Object의 Property를 이용하여 Hash 객체를 구현하는 예제코드입니다.구현 예제 (Language : javascript)function Hash () { var m_objHash = new Object(); this.put = function (key, value) { m_objHash[key] = value; } this.get = function (key) { return m_objHash[key]; } this.remove = function (key) { var temp = m_objHash[key]; delete m_objHash[key]; return temp; } this.getKeys = function () { var keys = new Array(); for (var key in m_objHash) { keys.push(key); } return keys; } }
Posted by young.un Tag Hash, JavaScript, Programming, 프로그래밍 Response You can track responses via RSS / ATOM feed No Trackback No Comment