Skip to content
New issue

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

Name property is not working But all properties are working fine why? #5318

Closed
Ghayyas opened this issue Oct 18, 2015 · 2 comments
Closed

Name property is not working But all properties are working fine why? #5318

Ghayyas opened this issue Oct 18, 2015 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@Ghayyas
Copy link

Ghayyas commented Oct 18, 2015

// Hi While im trying to learn typescript im getting Confuse with this code..

class Startup {

public static main(): number {
    console.log('Hello World');
    return 0;

}

}

Startup.main(); // works fine

class startUp{

   public static run(){
alert('hellow world run Static')
 }}

startUp.run(); // still works fine

class startup{

   public static name() {
    alert('hellow world');  
    }

}
startup.name(); //getting error why i dont understand??

/* i dont understand why its not working.. */

@xLama
Copy link

xLama commented Oct 18, 2015

Due to function name. You can notice if you exec Startup.name you get "Startup". Startup is a function and functions have a name property in Chrome.

http://i.imgur.com/fEiEu6s.jpg

@RyanCavanaugh
Copy link
Member

See #442

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Oct 19, 2015
@Ghayyas Ghayyas changed the title Name Method is not working But all method are working why? Name property is not working But all properties are working fine why? Oct 21, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants