The Object.setPrototypeOf() method is just another way to assign the [[prototype]] property of an object, which we have just discussed. You can either use this method or directly work with the __proto__ property. However, working with a method is a cleaner and easier-to-read approach. Here is an example to demonstrate this:
let x = {x: 12};let y = {y: 13};Object.setPrototypeOf(y, x);console.log(y.x); //Output "12"console.log(y.y); //Output "13"