对于es6我很新。以下是我的简单Student类与接受2个参数的构造函数。我通过在构造函数签名本身中调用函数来分配默认值,当参数未被传递时。 index.js:9Uncaught TypeError: this.defaultRno is not a function
at new Student (index.js:9)
at Object.<anonymous> (inde
我想弄清楚这里发生了什么,因为父类/超类在初始构建后没有数据。 //进口/服务器/一 - 和 - b.js class A {
constructor(id) {
// make MongoDB call and store inside this variable
// ...
this._LocalVariable = FieldFromMongo;
我想使用ES6解构一个类的构造函数,但得到一个未知的令牌错误。这里有一个例子: //进口/服务器/ A-和b.js class A {
constructor(id) {
// make MongoDB call and store inside this variable
let {
firstName: this._FirstName // => Th
我做这个类: import React, {Component} from 'react';
import {
View,
ActivityIndicator,
Button
} from 'react-native';
import Auth from '../api/Auth';
export default class LoginScreen ex