let myMap = new WeakMap()
function Test(some){myMap.set(this, some)}
let test = new Test("one")
console.log(myMap)
один then, один promise?читайте второй раз статью, можно еще
const privateThings = new WeakMap();
class Person {
constructor(name){
this.name = name
const farting = () => {
console.log("Pshhhhh", new Date())
}
privateThings.set(this, { farting })
}
sleeping(){
const { farting } = privateThings.get(this)
console.log(`${this.name} sleeping`)
setInterval(farting, 5000)
}
}
const Vasya = new Person("Vasya")
Vasya.sleeping();