function hook(param = null) {
let data = param;
let value = function(){
return data;
};
let setValue = function(val){
data = val;
};
// const newObj = new createDefaultObject(5);
// const a = 5;
// const a1 = x => console.log(x);
// const arr = [];
// arr.push(a);
// arr.push(a1);
// console.log(newObj.setValue(5));
return [value, setValue];
}
let [value, setValue] = hook('initial');
console.log(value());
setValue('working');
console.log(value());
setValue('not working');
console.log(value());