Javascript Interview Questions Answers 2.JS Basic Advanced.Javascript interview questions 2.Java.Script is a very widely used scripting language in web development.If you are a fresher who wants to build a career in Java.Script or an experienced developer, these frequently asked Java.Script interview Questions will definitely help you in preparing yourself for a job interview.Call Parent Window From Child Javascript W3schools' title='Call Parent Window From Child Javascript W3schools' />These interview questions of Java Script have been prepared by the experts who are experts in web development and are involved in the recruitment of Java.Script developers.You will rarely find such a gold mine of interview questions based on JS and its frameworks.Call Parent Window From Child Javascript W3schools' title='Call Parent Window From Child Javascript W3schools' />Download Javascript Interview Questions PDFThe compatibility of Java.Script with HTML and languages based on OOPS makes it the most preferred scripting language that adds to the interactivity of the website.You can pursue a very lucrative career with Java.Script as it is a technology that is here to stay.In this post, you can find the answers to both basic and advanced Java.Script Interview questions that will be beneficial for experienced as well as the freshers.If youre about to apply for a new exciting position and you feel like giving your Java.Script skills a test, this is the best moment to revisit your knowledge and make sure that you come for your interview well prepared.Here are top 2.Java.Script that professionals usually get asked during job interviews.Some Frequently Asked Java.Script Interview Questions.Question Differentiate between Java and Java.Script Answer While Java is a complete programming language, Java.Script is basically a coded program which developers can introduce to HTML pages.Java and Java.Script are two languages that arent inter dependent they were devised to serve completely different purposes.You have not yet voted on this site If you have already visited the site, please help us classify the good from the bad by voting on this site.It shouldnt be your call to decide whether the link should open in a new tab or a new window, since ultimately this choice should be done by the settings of the user.Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, and XML.Its worth to mention that Java has been programmed keeping the object oriented programming OOPS or structured programming language factor in mind just like C or C.When it comes to Java.Script, it is a client side scripting language and its generally considered to be an example of unstructured programming.Question When working with Java.Script, how do you organize your codeAnswer When asking this kind of question, the interviewer usually wants to know how the candidates design and maintain their code.Employers will be interested to know whether you design code which is application specific and will have no other use, or whether you use the module pattern or class inheritance to build a reusable code.There exist approaches which allow a number of developers to work together on a project without interfering with each others work.Its obvious that testing modular code or classes is a more approachable situation than a complex mess of code thrown together by one developer.Question How to differentiate between null and undefined Answer Lets enter the tricky land of technical Java.Script questions.Java.Script basically has two distinct values to stand for nothing null and undefined.While undefined means that value of the variable is not defined, null stands for empty or non existent value used by programmers to indicate no value.A few words about undefined.Java.Script has a global variable undefined bearing the value of undefined, as well as a type of undefined which is also undefined.Dont get confused here undefined is not a keyword or constant its a type bearing a single value undefined.Even if you assign a new value to it, you wont change the value of the type undefined.Null, on the other hand, isnt a type or an object its a primitive value.One of its characteristics as a value is the fact that you cant add properties to it.Many people wrongly assume null to be an object, mostly because type of null returns object.Question What is event bubblingAnswer This is a common question that pops up during interviews.Event bubbling basically defines the action of events in the Document Object Model DOM in child and parent nodes, where all child node events are conveyed to their parent nodes automatically.The main advantage of this method is the increased speed of coding, because the code will need to pass over the DOM tree once only.Event bubbling is a good option if youre placing more than one event listener on a DOM element you can use all of the elements to put just one listener, if you want to improve code simplicity and reduction.With event bubbling, you can create one event listener on the pages body element that will react to any click event that will occur within that element.Question Highlight the main differences between GET and POST methods in HTML formAnswer Using a GET method, you can get your key and values appended at the end of the URL in the form of a query string.Most developers avoid using GET method when theyre passing some sensitive data over the internet.When youre sending data, the GET method basically will extend the length of the URL and we all know that its limited latest browsers can support not more than 2.POST method is used by developers to pass sensitive data in such a way as to not append it and display it in the URL.In POST, there are no limitations when it comes to the amount of data that can be passed.Question How do you handle errors in Java.Script Answer If were talking about exceptions which occur at runtime, those are best handled by means of try catch finally blocks this way youll avoid those awful error notifications.The finally block is only optional, but trycatch is a must.What you do is basically attempt to run code in the try block located between the braces.Execution is then shifted to the catch block of code in case runtime errors take place.Once the trycatch block is completed, your code execution will transfer to the finally code block.This logic is similar to C or Java.Question How do you distinguish undefined variable and undeclared variable Answer The variable that are declared in the program but no value is assigned to them, are called undefined variable.Undeclared variables are the ones that are not declared in the program.Undeclared Variable.This will give error because a is undeclared variable.This will give error because a is undefined.Undeclared Variable lt script varp alerta This will give error because a is undeclared variable.This will give error because a is undefined.Question Why do developers include use strict at the beginning of a Java.Script source file What are the benefits of this strategyAnswer Using use strict, developers enforce stricter parsing and error handling on their Java.Script code at runtime.Code errors that could have been ignored or failed with no sign whatsoever will now generate errors or throw exceptions.All in all, using use strict is an excellent measure against losing time later on improving the code.Its main benefits are as follows it makes debugging easier, it eliminates a this value coercion, it prevents the creation of accidental global variations, it throws error on invalid use of delete, it makes eval safer and it doesnt allow duplicate property names or parameter values.Question How to request data from the server without the page being reloaded in the browser Answer Java.Script that is being executed on the clientss system can request the data from the server by using XMLHttp.Request object.Imr Powder Load Data 243 Ackley '>Imr Powder Load Data 243 Ackley .This method opens the connection and XMLHttp.Request.The following code makes it simpler to understand.Request new XMLHttp.Request.URL http self.Request.GET,s.URL,false.Request.Request. HeaderUser Agent,navigator.Agent.Request.Request.Request.Text. else alertError executing XMLHttp.Request call varo.Requestnew.XMLHttp.Request vars.URLhttp self.Request.GET,s.URL,false o.Request.Request. Download Windows 7 Updates Slipstreaming . HeaderUser Agent,navigator.Agent o.Request.Request.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |