Ans:
Ans: This is determined by the JavaScript environment. All scripts on the client (browser environment) can refer to variables/functions declared in the global scope (window). For a more modular approach, use Asynchronous Module Definition (AMD) through RequireJS.
.
.
The most popular approach on the server (Node.js) has been to utilize CommonJS. Each file is considered a module, and by adding variables and functions to the module, it may export them. The object is exported. ES2015 specifies a module syntax that is intended to replace both AMD and CommonJS. This will be supported in both browser and Node environments in the future.
Ans: Disadvantages of GraphQL are:
Ans: CORS is an acronym that stands for Cross-Origin Resource Sharing. It is a W3C standard and a method based on HTTP headers. It allows a server to indicate any additional sources (such as domains, ports, and so on) instead of the requested one. In other words, it allows one website to use JavaScript to access the resources of another website.
.
.
It allows for safe cross-origin requests and data transmission between servers and browsers. CORS is used in APIs by advanced browsers. In comparison to JSONP, it is more adaptable and secure (JSON with Padding). It improves web service integration.
.
.
The same CORS service may be utilized when using MVC to enable CORS; however, we cannot use the same CORS middleware. We may utilize a certain CORS for a specific action, a specific controller, or globally for all controllers. The browser sends a pre-flight check (or request) to the server (hosting the cross-origin resource) to determine if the server will allow the real request or not.
Ans: Double brace initialization in Java is a mixture of two distinct operations. It involves two consecutive curly brackets. The initial curly brace symbolizes the formation of an unnamed inner class. Keep in mind that the second curly brace will not be evaluated in this situation. It's the same as establishing an anonymous inner class. The second curly brace represents an initialization block, which we've already seen as a class for initialization. When we use the initialization block for an anonymous inner class, it transforms into Java double brace initialization. The inner class refers to the outer class it is enclosed by. Using this pointer, we may access the reference. It is used to initialize collections because double brace initialization makes it easier to initialize a constant collection.
|