A piece of code about how to implement instanceof

function instanceof(left, right) {
    // 
    let prototype = right.prototype
    // 
    left = left.__proto__
    // 
    while (true) {
        if (left === null)
            return false
        if (prototype === left)
            return true
        left = left.__proto__
    }
}

I feel like I made a fake front end two years ago, and I don"t understand the meaning of this code at all. Why do you set left=left.__proto__
outside the while and repeat it in the loop? Solve

Mar.14,2022

this is not a repeated setting. Each loop will check whether left is null and whether it is equal to prototype . If none of the conditions are true, then replace the left.__proto__ assignment left
with the following. In the first loop, the obj = left.__proto__ of the above if statement, if if When entering the second loop, obj = left.__proto__.__proto__ . Then cycle again and again until obj = null or obj = prototype ends.

  

on my knees. Thank you very much. Thank you very much. Thank you for saying nothing. Thank you

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e671fc-446df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e671fc-446df.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?