0

I have part of typescript code

  var root = window['appPath'] 
  window.location.replace(root + '.... some url

Is the variable windows part of typescript? How do I assign it? Is it a key/value and what can I store in it? Thanks

1 Answer 1

3

Is the variable windows part of typescript

Its a part of browser spec : http://www.w3schools.com/jsref/obj_window.asp

TypeScript defines these common globals for you in a file lib.d.ts : https://github.com/Microsoft/TypeScript/blob/master/bin/lib.d.ts

How do I assign it?

You shouldn't and actually browsers will not let you.

Is it a key/value and what can I store in it?

All JavaScript objects (I'm being lose here) act like key/value stores. The only allowed key is string. Value can be any other JavaScript object.

That said. DONT PUT STUFF ON WINDOW. MILLIONS OF KITTENS WILL DIE

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.