Question:- What is the difference between cookies and local storage?
Answer:- Cookies • Cookie data is accessible for both the client and the server • Cookies have an expiry time, and data gets deleted post expiration Local Storage • Data is stored only on the local browser in the client-side machine • There is no expiry in local storage unless the data is manually deleted
Question:- What is the difference between XHTML and HTML?
Answer:- XHTML • Tags should be in lowercase • Tags should be closed once opened • Attributes must be enclosed in double quotes HTML • It is not case sensitive • Open-ended tags can be used • Attributes can be used without quotation marks
Question:- What are the various data types present in JavaScript?
Answer:- JavaScript supports the following data types: • Boolean • Number • Object • Undefined • Null • String • Function
Question:- What are the types of popup boxes present in JavaScript?
Answer:- There are three types of dialog boxes, which are used in JavaScript: • Alert: Presents users with a message and an Ok button • Confirm: Gives the users a window with Ok and Cancel buttons • Prompt: Shows the user input, alongside Ok and Cancel buttons
Question:- What is the difference between < window.onload> and < onDocumentReady>?
Answer:- The < window.onload> event is not called until a page is completely loaded with the entire styling from CSS and images. The event does add a bit of delay when rendering a web page. With the < onDocumentReady> event, it will wait only till the DOM is initialized and will begin the event action. This ensures to reduce any delays in actions.
Question:- How is type conversion handled in JavaScript?
Answer:- JavaScript supports automatic type conversion. Since it is weakly typed, you can pass a function as an argument into another function easily. This ensures that there are no errors or data type-associated warnings as values get converted to the required data type automatically.
Question:- What is the meaning of the scope of a variable in JavaScript?
Answer:- Scope refers to the accessibility of functions and underlying variables in the running environment. There are two scopes supported in JavaScript: • Local scope: Here, values and functions declared inside the same function can only be accessed within that function and not outside it. • Global scope: If a variable is declared as global, it can be accessed from anywhere in the application.
Question:- How are comments used in JavaScript?
Answer:- JavaScript supports two types of comment insertion in the code. Single-line comments and multi-line comments. • Single-line comment: “//” is used for single-line comment insertion • Multi-line comment: “/* */” is used to add multi-line comments
Question:- How can you prioritize SEO, maintainability, performance, and security in a web application?
Answer:- This is a commonly asked question in a Web Development interview. Here, the interviewer is trying to assess your understanding of the working environment in the firm you’ve applied for. If it is a large firm, then security will get higher priority over SEO. Whereas, if it is a publication firm, SEO gets the preference. A little groundwork about the company should help you answer this question. The next web developer interview question we will look at is regarding jQuery.
Question:- What is the result if a jQuery Event Handler returns false?
Answer:- If the jQuery Event Handler returns a boolean false value, it simply means that the event will not execute further and will halt the execution for the particular action it is associated with.
Question:- What is the use of the each() function in jQuery?
Answer:- The each() function in jQuery is used to iterate over a set of elements. A function can be passed to each() method. This will result in the execution of each of the events for which the object has been called.
Question:- What is Pair Programming?
Answer:- Pair programming is a scenario where you will be working closely with a colleague on the project, and this is done to help solve the problems at hand. If the development scenario is fast-paced, Agile development might not work efficiently. The interviewer asks this question to see whether you can work with other people easily and effectively.
Question:- What is the use of the $() function in jQuery?
Answer:- The $() function is used as a wrapper to wrap objects into their jQuery counterparts. This is done to give users the ability to call any method that is defined for the jQuery object. Note: Selectors can also be passed to the $() function, resulting in the output of a jQuery object that contains matched DOM elements.
Question:- What are the advantages of using a Content Delivery Network (CDN) in jQuery?
Answer:- CDNs are widely used in jQuery as they offer an ample number of advantages for users. • CDNs cause a significant reduction in the load for the server. • They provide large amounts of savings in the bandwidth. • jQuery frameworks load faster due to optimizations. • CDNs have a caching ability that adds to quicker load times.
