This is my code .
function promis(callBack){
Object.prototype.thens=(values)=>{
let k=false
callBack((value)=>{
k=true
setImmediate (()=>{
return values (value)
})
},()=>{
return false
})
return k
}
Object.prototype.catchs=(catchsCallBack)=>{
callBack(()=>{
return false
},(value)=>{
setImmediate(()=>{
catchsCallBack(value )
})
})
}
}
let p=new promis((resolve,regect)=>{
console.log("promis callback")
resolve("posetive")
regect("error")
})
p.thens((j)=>{
console.log(j)
return j
}).catchs((err)=>{
console.log(err)
})
Is it correct. If not, what is the source code of Promise constructor