1. 程式人生 > >JS高級——instanceof語法

JS高級——instanceof語法

back n) 使用 基本使用 col on() class new -c

基本語法

對象 instanceof 構造函數

基本使用

<script>
    function Person() {

    }

    //p--->Person.prototype--->Object.prototype--->null
    var p = new Person();
    console.log(p instanceof Person);//true
</script>

JS高級——instanceof語法