如果我定義了兩個類如下... class A {
getParentInstance(...args) {
return new super.constructor(...args);
}
}
class B extends A {}
console.log((new B).getParentInstance().constructor.name);
O
如何安裝bunyan記錄器,以便在他們可以爲他們自己的記錄儀獲取bunyan的孩子的路線上? 嘗試: import * as restify from 'restify';
import {createLogger} from 'bunyan';
let app = restify.createServer();
app.use(restify.queryParser());
app.
這是一門課程的練習,它可以創建一個函數來模擬如何從對象中檢索屬性,以便更好地瞭解正在發生的事情。 DOT = function dotFunc(obj, prop){
// if this obj has this property just return it
if(obj.hasOwnProperty(prop)){
return obj[prop];