As the title said, or can I just use them directly without any declaration? (It seems a dumb question, but I want to make sure nothing goes wrong in these subtle aspects.)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unfortunately, not all browsers have every single method available (especially older ones). In those cases, there are plenty of solutions that people post that you can include in your script to fix it. For example, the .indexOf() method for arrays is not available in older versions of IE. But, there’s a very simple function you can write, such as:
There are newer methods that help ease the use of JSON but are not available in older browsers. Those, as well, have simple functions that people have written for you to include in case the browser doesn’t support it.
So for the most part, for probably all of the types, methods, functions and anything else that you want to use that is a part of Javascript is available for you to use without any importing, including or declaration.