constructor function in javascript example