AIDS Meanstack development Quiz:
HTML5:
What does HTML5 stand for?
- HTML5 stands for Hypertext Markup Language version 5.
What are the new semantic tags introduced in HTML5?
- Some of the new semantic tags introduced in HTML5 are
<header>,<nav>,<article>,<section>,<aside>,<footer>,<main>, and<figure>.
- Some of the new semantic tags introduced in HTML5 are
What is the purpose of the
<video>and<audio>elements in HTML5?- The
<video>and<audio>elements in HTML5 are used to embed video and audio content in web pages.
- The
What is the difference between the
<canvas>and<svg>elements in HTML5?- The
<canvas>element in HTML5 is used for drawing graphics dynamically using JavaScript, while the<svg>element is used for drawing scalable vector graphics.
- The
What is the purpose of the
contenteditableattribute in HTML5?- The
contenteditableattribute in HTML5 is used to make an element editable, so that users can modify the text and content within that element.
- The
What is the difference between the
requiredandpatternattributes of the<input>element in HTML5?- The
requiredattribute of the<input>element in HTML5 is used to make a form input field mandatory, while thepatternattribute is used to validate the format of the input data.
- The
What is the purpose of the
localStorageandsessionStorageobjects in HTML5?- The
localStorageandsessionStorageobjects in HTML5 are used to store data on the client side, which can be accessed and modified by JavaScript code.
- The
What is the purpose of the
datalistelement in HTML5?- The
datalistelement in HTML5 is used to provide a list of predefined options for an<input>element, which can be selected by the user.
- The
What is the difference between the
downloadandtargetattributes of the<a>element in HTML5?- The
downloadattribute of the<a>element in HTML5 is used to download a linked file instead of navigating to it, while thetargetattribute is used to specify where to open the linked document.
- The
What is the purpose of the
asyncanddeferattributes of the<script>element in HTML5?- The
asyncanddeferattributes of the<script>element in HTML5 are used to specify how JavaScript code should be loaded and executed in a web page. Theasyncattribute loads the script asynchronously, while the rest of the page continues to load, while thedeferattribute loads the script after the rest of the page has loaded
- The
Javascript:
What is JavaScript?
- JavaScript is a high-level, dynamic, and interpreted programming language used to create dynamic web content and provide interactive functionality on web pages.
What are the data types supported by JavaScript?
- JavaScript supports various data types, including numbers, strings, booleans, null, undefined, objects, and arrays.
What is the difference between
nullandundefinedin JavaScript?nullis an explicitly assigned value that represents the absence of any object value, whileundefinedis a variable that has not been assigned a value.
What is the purpose of the
typeofoperator in JavaScript?- The
typeofoperator in JavaScript is used to determine the data type of a variable or expression.
- The
What is a closure in JavaScript?
- A closure is a function that has access to variables in its outer (enclosing) function, even after the outer function has returned.
What is the purpose of the
thiskeyword in JavaScript?- The
thiskeyword in JavaScript refers to the object that the function is a method of, or the global object if the function is not part of an object.
- The
What is the difference between
let,const, andvarin JavaScript?letandconstare block-scoped, meaning they are only accessible within the block they were defined in, whilevaris function-scoped, meaning it can be accessed within the function it was defined in or in any nested functions.constis used to declare a variable that cannot be reassigned a new value, whileletandvarcan be reassigned.
What is a callback function in JavaScript?
- A callback function is a function passed as an argument to another function, which is then called inside the outer function.
What is the purpose of the
map()function in JavaScript?- The
map()function is used to create a new array with the results of calling a provided function on every element in the original array.
- The
What is the difference between synchronous and asynchronous code in JavaScript?
- Synchronous code is executed sequentially and blocks the execution until the previous code has completed, while asynchronous code is executed concurrently and allows other code to run while it is being executed.
What is a promise in JavaScript?
- A promise is an object representing the eventual completion or failure of an asynchronous operation in JavaScript.
What is the difference between
==and===in JavaScript?==is a loose equality comparison that performs type coercion if necessary, while===is a strict equality comparison that does not perform type coercion.
What is the difference between
nullandundefinedin JavaScript?nullis an explicitly assigned value that represents the absence of any object value, whileundefinedis a variable that has not been assigned a value.
What is the purpose of the
Array.from()method in JavaScript?- The
Array.from()method in JavaScript is used to create a new, shallow-copied array from an array-like or iterable object.
- The
What is hoisting in JavaScript?
- Hoisting in JavaScript is a behavior where variable and function declarations are moved to the top of their respective scopes, allowing them to be accessed before they are declared in the code
What is Node.js?
- Node.js is an open-source server-side platform built on Chrome's V8 JavaScript engine that allows for the creation of scalable, high-performance applications.
What is Express.js?
- Express.js is a lightweight, open-source web application framework for Node.js that provides a set of features and tools for building web and mobile applications.
What is the difference between Node.js and Express.js?
- Node.js is a platform, while Express.js is a framework built on top of Node.js.
- Node.js provides the runtime environment for executing JavaScript on the server-side, while Express.js provides a set of features and tools for building web applications, including routing, middleware, and templating.
What is npm?
- npm is the Node.js package manager, used for installing, managing, and sharing packages and dependencies for Node.js applications.
What is a middleware in Express.js?
- A middleware in Express.js is a function that can be executed before the actual request handler is called. It can modify the request and response objects, and pass control to the next middleware function.
What is the purpose of the
body-parsermiddleware in Express.js?- The
body-parsermiddleware in Express.js is used to parse incoming request bodies in a middleware before the actual handler, and make them available underreq.bodyproperty.
- The
What is a route in Express.js?
- A route in Express.js is a way to map incoming requests to the corresponding handler function based on the HTTP method and the URL path.
What is a callback in Node.js?
- A callback in Node.js is a function that is passed as an argument to another function and is executed after the first function has completed its task.
What is a Promise in Node.js?
- A Promise in Node.js is an object that represents the eventual completion or failure of an asynchronous operation and is used for handling asynchronous operations.
What is the difference between
require()andimportin Node.js?require()is the CommonJS module system used in Node.js to load modules and dependencies, whileimportis the ES6 module system used in modern JavaScript.
What is the purpose of the
pathmodule in Node.js?- The
pathmodule in Node.js provides utilities for working with file and directory paths, making it easier to build cross-platform applications.
- The
What is the difference between
httpandhttpsin Node.js?httpis a module in Node.js used for creating a web server that listens for incoming requests over the HTTP protocol, whilehttpsis a module used for creating a secure web server that listens for incoming requests over the HTTPS protocol.
What is the difference between
process.nextTick()andsetImmediate()in Node.js?process.nextTick()is used to schedule a callback function to be called on the next iteration of the Node.js event loop, whilesetImmediate()is used to schedule a callback function to be called at the earliest opportunity in the event loop.
What is the purpose of the
fsmodule in Node.js?- The
fsmodule in Node.js provides a set of tools for working with the file system, including reading and writing files, creating and deleting directories, and more.
- The
What is a template engine in Express.js?
- A template engine in Express.js is a tool that allows for the dynamic generation of HTML pages by rendering templates with data. Common template engines used in Express.js include Handlebars, EJS
What is TypeScript? Answer: TypeScript is a statically typed superset of JavaScript that adds features such as optional static typing, classes, and interfaces.
What is the difference between TypeScript and JavaScript? Answer: TypeScript is a superset of JavaScript, which means it has all the features of JavaScript and more. The main difference is that TypeScript is statically typed, which means it allows you to declare the types of variables and function parameters.
What are some benefits of using TypeScript? Answer: Some benefits of using TypeScript are:
- Static typing helps catch errors before runtime
- Better code organization with classes and interfaces
- Improved tooling support for IDEs
- Better documentation with type annotations
- How do you declare a variable in TypeScript? Answer: You can declare a variable in TypeScript using the 'let' or 'const' keyword followed by the variable name and its type. For example:
What is the difference between 'let' and 'const' in TypeScript? Answer: 'let' declares a mutable variable, while 'const' declares an immutable variable.
What is an interface in TypeScript? Answer: An interface in TypeScript is a way to define a contract that a class or object must follow. It defines a set of properties and methods that must be implemented by the class or object.
How do you define a function in TypeScript? Answer: You can define a function in TypeScript using the 'function' keyword followed by the function name, parameters, and return type. For example:
What are generics in TypeScript? Answer: Generics in TypeScript allow you to create reusable code that can work with different types of data. They allow you to define a type parameter that can be used throughout the code.
How do you import and export modules in TypeScript? Answer: You can import and export modules in TypeScript using the 'import' and 'export' keywords. For example, to export a function:
Comments
Post a Comment