首页 > 解决方案 > Can't print a method with es6 class

问题描述

Why does the code below not produce an output when logging showInstall

class crud_actions {
    constuctor(second){
        this.allitems_colection = 'main',
        this.allitems_example = second
    }
    listall() {   return  this.allitems_example;    }   
}

var test = new crud_actions('solo');
var showinstall = test.listall();

console.log(showinstall);

标签: javascriptstandardses6-class

解决方案


推荐阅读