0

I have something like this

if(window.Test==null)
{
    window.Test = {};
    Test.usrTZ = Test.getTZ( new Date().getTimezoneOffset() );

    Test.getTZ = function(offset)
    {
     .....
     return offset;
    };

}

The line Test.usrTZ = Test.getTZ( new Date().getTimezoneOffset() ); throws in Chrome an error "Uncaught TypeError: undefined is not a function". I in general use traditional object notation, but want to learn how to use this one. I'm not sure what I'm doing wrong here - any help is much appreciated!

1 Answer 1

3

You are calling Test.getTZ before you have defined it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.