We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have Javascript link this.
someClass.js
class someClass { constructor(name, age) { this.name = name; this.age = age; } sayName() { console.log(this.name); } sayAge() { console.log(this.age); } } var myInstance = new someClass('dwayne', 27); myInstance.sayName();
In cmd:
node someClass.js It's show dwayne.
But show I want to use this class in another class like: someClassTest.js How can I call someClass.js for same result
Thanks.
The text was updated successfully, but these errors were encountered:
This is not a general support forum. Try Stack Overflow perhaps.
Sorry, something went wrong.
class someClass{
constructor(name, age){ this.name = name; this.age = age; }
getName(){ return this.name; }
getAge(){ return this.age; } }
var myInstance = new someClass("John", 27);
// var doc = document.getElementById("test"); // doc.innerHTML = "Name: " + myInstance.getName() + " Age:" + myInstance.getAge();
class someClassTest{
constructor(name){ this.name = name; }
getName(){ console.log("New instanced passed: " + this.name); console.log(myInstance.getName()); } }
var newInstance = new someClassTest(myInstance.getName());
newInstance.getName();
On Thu, Sep 8, 2016 at 8:51 AM, Kyle Simpson notifications@github.com wrote:
This is not a general support forum. Try Stack Overflow perhaps. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub #111 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ATlJsiI91oNaVtEA9Vv92e2fYGKS_e8_ks5qoC8OgaJpZM4J4ASI .
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub #111 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/ATlJsiI91oNaVtEA9Vv92e2fYGKS_e8_ks5qoC8OgaJpZM4J4ASI .
No branches or pull requests
I have Javascript link this.
someClass.js
In cmd:
node someClass.js
It's show dwayne.
But show I want to use this class in another class like: someClassTest.js How can I call someClass.js for same result
Thanks.
The text was updated successfully, but these errors were encountered: