0% found this document useful (0 votes)
13 views33 pages

Web X-UT1-QB

The document covers various topics related to web technologies, including RDF, KPIs for website success, components of the Semantic Web, AngularJS features, and clickstream analysis. It discusses the advantages and disadvantages of AngularJS, multilevel inheritance in TypeScript, and the characteristics of the Semantic Web. Additionally, it explains controllers in AngularJS, routing directives, and the $http service, along with the web analytics process.

Uploaded by

saanvisawant1712
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views33 pages

Web X-UT1-QB

The document covers various topics related to web technologies, including RDF, KPIs for website success, components of the Semantic Web, AngularJS features, and clickstream analysis. It discusses the advantages and disadvantages of AngularJS, multilevel inheritance in TypeScript, and the characteristics of the Semantic Web. Additionally, it explains controllers in AngularJS, routing directives, and the $http service, along with the web analytics process.

Uploaded by

saanvisawant1712
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Web X.

0 Question Bank UT1

1.​ Explain RDF.


-​ RDF (Resource Description Framework) is a standard model for
structuring and exchanging data on the web. It provides a way to
describe relationships between different pieces of data in a
machine-readable format, forming the foundation of the Semantic
Web.
-​ The Key Features of RDF:
➔​Triple- Based Structure: RDF represents data as triples i.e.
subject-predicate-object
➔​Uses of URIs: RDF relies on Uniform Resource Identifiers
(URIs) to uniquely identify resources and properties, preventing
ambiguity.
➔​Serialization Formats: RDF data can be represented in different
formats, such as: RDF/XML, Turtle, N-Triples, JSON-LD
➔​Extensibility with RDFS & OWL: RDFS (RDF Schema)
defines classes and properties for RDF data. OWL (Web
Ontology Language) this adds reasoning capabilities for
defining complex relationships
-​ Applications of RDF:
➔​Knowledge Graphs (e.g. Google, Wikidata)
➔​Semantic Search (enhancing search engine understanding)
➔​Data Integration (linking data across sources)
➔​AI & Machine Learning (improving data relationships)
➔​Linked Data (connecting open datasets)

2.​ What are the top KPIs that help to determine the success of your
website?
-​ The Key Performance Indicators (KPIs) that determine the success of
a website depend on its purpose (e.g., e-commerce, informational, or
service-based). Below are some of the most important KPIs:
-​ Website Traffic Metrics: This includes
➔​Total Visitors & Unique Visitors – Number of people visiting
your site.
➔​Traffic Sources – Where visitors come from (organic search,
paid ads, social media, direct, referral).
➔​Bounce Rate – Percentage of visitors leaving after viewing only
one page (lower is better).
➔​Session Duration & Pages per Session – Measures user
engagement and time spent on your site.
-​ Conversion Metrics: This includes:
➔​Conversion Rate – Percentage of visitors completing a desired action
(purchase, sign-up, download).
➔​Cart Abandonment Rate (E-commerce) – Percentage of users adding
items to the cart but not completing the purchase.
➔​Lead Generation Metrics – Number of form submissions, newsletter
sign-ups, or downloads.
-​ SEO Performance Metrics:
➔​Organic Traffic – Visitors from search engines like Google.
➔​Keyword Rankings – How well your site ranks for important
keywords.
➔​Click-Through Rate (CTR) – Percentage of people clicking on your
site from search results.
-​ User Experience (UX) Metrics:
➔​Page Load Speed – Faster sites improve user experience and reduce
bounce rates.
➔​Mobile Responsiveness – Percentage of users accessing from mobile
devices and how well the site adapts.
➔​Error & Broken Links – Issues affecting navigation and usability.
-​ Customer Engagement & Retention:
➔​Return Visitor Rate – Percentage of users coming back to your site.
➔​Social Media Engagement – Shares, likes, and comments driving
traffic.
➔​Customer Reviews & Ratings – User feedback on products or
services.
-​ For E-commerce:
➔​Revenue per Visitor (RPV) – Average revenue generated per website
visitor.
➔​Customer Lifetime Value (CLV) – Predicted revenue from a single
customer over time.
➔​Return on Investment (ROI) – Profitability of marketing campaigns.
-​ Website Security & Performance:
➔​Downtime – Time the website is unavailable (should be minimal).
➔​Security Issues – Hacking attempts, malware alerts, and SSL
certificate status.

3.​ What are the components of Semantic Web?


-​ Semantic Web is an extension to the World Wide Web. The purpose of the
semantic web is to provide structure to the web and data in general. It
emphasizes on representing a web of data instead of web of documents. It
allows computers to intelligently search, combine and process the web
content based on the meaning that the content has.
-​ Its key components include:
-​ RDF (Resource Description Framework) – Provides a standard for
structuring data using triples (subject-predicate-object).
➔​RDFS (RDF Schema) – Defines vocabularies, relationships, and
classes for RDF data.
➔​OWL (Web Ontology Language) – Enables more advanced reasoning
and classification of web data.
➔​SPARQL (Query Language) – A query language used to retrieve and
manipulate Semantic Web data.
➔​URI (Uniform Resource Identifier) – Provides unique identification
for web resources.
➔​Linked Data – Connects datasets across the web to enhance
discoverability and integration.
➔​Reasoning & Inference Engines – Helps derive new knowledge from
existing data relationships.
-​ These components work together to create a web where data is
interconnected, machine-readable, and more intelligent.
4.​ What is the Function type in TypeScript?
-​ In TypeScript, the Function type is used to define the type of
functions, specifying parameters and return values to ensure type
safety.
-​ Ways to Define Function Types in TypeScript:
I.​ Explicit Function Type Declaration:

A function must take 2 numbers and return a number

II.​ Function with type annotations:

III.​ Using Function Type

The Function type allows any function but lacks strict


type-checking for parameters and return types
IV.​ Arrow Function Type:

V.​ Rest Parameters:

5. List advantages and disadvantages of AngularJS.


Advantages of AngularJS:
-​ Two-Way Data Binding – Synchronizes the model and view automatically,
reducing boilerplate code.
-​ MVC Architecture – Separates concerns, making development more
organized.
-​ Reusable Components – Directives and components enhance code
reusability.
-​ Dependency Injection (DI) – Simplifies service management and testing.
-​ Built-in Testing Support – Comes with tools like Karma and Jasmine for unit
testing.
-​ Single-Page Application (SPA) Support – Enhances performance by loading
pages dynamically.
-​ Rich Ecosystem – Offers a variety of built-in features like HTTP client,
routing, and forms handling.
Disadvantages of AngularJS:
-​ Performance Issues – Two-way data binding can slow down applications
with large datasets.
-​ Steep Learning Curve – Concepts like directives, DI, and scopes can be
complex for beginners.
-​ Limited SEO Support – SPAs require extra effort for search engine
optimization.
-​ Scope Complexity – The digest cycle and scope hierarchy can cause
debugging difficulties.
-​ Migration Challenges – Upgrading from AngularJS to newer Angular
versions (like Angular 2+) requires significant effort.
-​ Heavy Framework – Compared to alternatives like React or Vue.js,
AngularJS can be bulky.

6. Define $scope in AngularJS


-​ In AngularJS, $scope is an object that acts as a bridge between the
controller and the view (HTML). It holds the application's data and methods,
making them accessible to both.
-​ The key features of $scope:
➔​Two- Way Data Binding: Automatically updates the view when the
model changes and vice versa.
➔​Acts as a Context – Stores variables and functions that controllers
expose to the view.
➔​Hierarchical Structure – Follows the DOM structure, allowing child
scopes to inherit from parent scopes.
➔​Manages Events – Facilitates event handling using $broadcast,
$emit, and $on.
-​ Example of $scope in AngularJS:
7. Define AngularJS and what are its key features? List advantages and
disadvantages of AngularJS.
-​ AngularJS is a JavaScript framework developed by Google for
building dynamic, single-page web applications (SPAs). It extends
HTML with additional attributes and provides a structured way to
create interactive and data-driven web applications.
-​ The key features of AngularJS:
➔​Two-Way Data Binding – Synchronizes data between the model
and view automatically.
➔​MVC Architecture – Follows Model-View-Controller for
organized development.
➔​Directives – Custom HTML attributes (ng-model, ng-bind,
ng-repeat) that enhance functionality.
➔​Dependency Injection (DI) – Manages dependencies efficiently
for modular development.
➔​Routing – Built-in support for Single Page Applications (SPA)
navigation.
➔​Templates – Uses declarative HTML-based templates.
➔​Filters & Services – Helps process data and reuse business logic
across the app.
-​ The Advantages and disadvantages of AngularJS are:
-​ Two-Way Data Binding – Synchronizes the model and view automatically,
reducing boilerplate code.
-​ MVC Architecture – Separates concerns, making development more
organized.
-​ Reusable Components – Directives and components enhance code
reusability.
-​ Dependency Injection (DI) – Simplifies service management and testing.
-​ Built-in Testing Support – Comes with tools like Karma and Jasmine for unit
testing.
-​ Single-Page Application (SPA) Support – Enhances performance by loading
pages dynamically.
-​ Rich Ecosystem – Offers a variety of built-in features like HTTP client,
routing, and forms handling.
Disadvantages of AngularJS:
-​ Performance Issues – Two-way data binding can slow down applications
with large datasets.
-​ Steep Learning Curve – Concepts like directives, DI, and scopes can be
complex for beginners.
-​ Limited SEO Support – SPAs require extra effort for search engine
optimization.
-​ Scope Complexity – The digest cycle and scope hierarchy can cause
debugging difficulties.
-​ Migration Challenges – Upgrading from AngularJS to newer Angular
versions (like Angular 2+) requires significant effort.
-​ Heavy Framework – Compared to alternatives like React or Vue.js,
AngularJS can be bulky.

8. Explain clickstream analysis in brief. State Advantages and Disadvantages.


-​ Clickstream Analysis is the process of tracking, analyzing, and interpreting
users' online behavior by recording their clicks, navigation paths, and
interactions on a website or app.
-​ It helps businesses understand user preferences, optimize websites, and
improve conversions.
-​ The clickstream analysis work in 5 steps and they are:
➔​Data Collection: Tracks user activities like clicks, page views, time
spent, and navigation paths
➔​Data Storage: Stores clickstream logs in databases or analytics
platforms
➔​Data Processing: Cleans and organizes the data for meaningful
insights
➔​Analysis & Interpretation: Uses AI, machine learning, or analytics
tools to identify trends.
➔​Action & Optimization: Businesses use insights to enhance website
UX, marketing strategies, and conversions.
-​ Advantages:
➔​C- Customer Insights: Helps understand user preferences and
behaviors.
➔​ L – Lead Conversion: Optimizes marketing efforts to increase sales
and engagement.
➔​I – Improved Website Experience: Enhances navigation and user
satisfaction.
➔​C – Cost Efficiency: Data-driven decisions reduce wasted marketing
spend.
➔​K – Key Performance Monitoring: Tracks website performance and
user flow effectively.
-​ Disadvantages:
➔​C – Complexity: Requires technical expertise to process and analyze
large data.
➔​L – Legal & Privacy Concerns: Must comply with GDPR, CCPA, and
other data regulations.
➔​I – Incomplete Insights: Click data alone may not fully explain user
intent.
➔​C – Cost of Implementation: Advanced analytics tools and data
storage can be expensive.
➔​K – Knowledge Gaps: Incorrect analysis can lead to misleading
conclusions.

9. Explain Multilevel Inheritance in Typescript with suitable example


-​ Multilevel Inheritance in TypeScript is a type of inheritance where a class
inherits from another class, which in turn is inherited by another class. This
forms a chain of inheritance, where properties and methods are passed down
multiple levels.
-​ The advantages of multilevel inheritance are: Code reusability, Better
Organization and Extensibility
-​ Example of multilevel inheritance:
-​ The output of the given code is:

-​ Here in the code:


-​ Animal (Base Class) - Defines general properties of an animal
-​ Mammal (Derived from Animal) - Adds characteristics specific to mammals
-​ Dog (Derived from Mammals)- Specializes further by adding dog-specific
behaviour

10. Explain Characteristics of Semantic Web


-​ The Semantic Web is an extension of the traditional web that aims to make
data machine-readable and intelligently processable by adding meaning
(semantics) to web content.
-​ It is based on technologies like RDF (Resource Description Framework),
OWL (Web Ontology Language), and SPARQL (Query Language for
Semantic Data).
-​ The characteristics of the Semantic Web
-​ S – Standardized Formats – Uses RDF, OWL, and XML for structured data
representation.
-​ E – Enhanced Searchability – Improves search engines by understanding
intent, not just keywords.
-​ M – Machine Readability – Allows computers to process and interpret web
data meaningfully.
-​ A – Automated Reasoning – Uses AI to infer new knowledge from existing
data.
-​ N – Networked Data (Linked Data) – Connects related information across
different sources.
-​ T – Trust & Security – Ensures reliable and verified data exchange.
-​ I – Interoperability – Enables seamless data sharing between different
platforms and applications.
-​ C – Context Awareness – Understands the meaning of data in various
scenarios.

11. Explain controllers in AngularJS with example


-​ In AngularJS, a controller is a JavaScript function that manages the
application's data and logic. It acts as a bridge between the view (HTML)
and the model (data), handling user interactions and updating the UI
accordingly.
-​ The Key Features of Controllers:
-​ Manages Application Data – Controls the flow of data in AngularJS
applications.
-​ Uses $scope Object – Binds data between the controller and view.
-​ Handles User Interactions – Processes inputs, updates data, and triggers
events.
-​ Defined Inside AngularJS Modules – Controllers are part of AngularJS
modules for better organization.
-​ Example:
12. Explain Routing using ng-Route, ng-Repeat, ng-style, ng-view. With
suitable example
-​ AngularJS provides powerful directives to manage routing, iteration,
dynamic styling, and view rendering. Below is a detailed explanation with
examples for each.
-​ ngRoute enables single-page applications (SPA) by allowing users to
navigate between views without reloading the page. Requires AngularJS
Route Module (angular-route.js)
-​ ng-repeat is used for iterating over data. It is used to loop through an array
and display a list dynamically

-​ ng-style: It changes style dynamically.


-​ Ng-view: works with ngRoute to display different content. It is used view
management making angular applications more efficient
13. Differentiate Var v/s Let. In addition, Explain function overloading with
example

-​ Function Overloading in TypeScript: Function overloading allows multiple


function signatures for the same function name with different parameter
types or numbers.
-​ Example for function overloading in TypeScript

14. Explain AngularJS $http service in detail with its get() and post() methods.
-​ $http is an AngularJS service used to make HTTP requests (AJAX calls)
to fetch or send data to a server.
-​ It returns a promise, which handles the asynchronous request.
-​ Supports GET, POST, PUT, DELETE, etc. for RESTful API communication.
-​ It uses various methods such as $http.get() , $http.post() methods
-​ $http.get() Method: Used to retrieve data from a server. The syntax for
$http.get() method

-Example:

-​ $http.post(): Used to send data to a server. The syntax for the same is:
-​ Example:

15. Explain Web Analytics and steps involved in Web Analytics Process
-​ Web Analytics is the process of collecting, analyzing, and reporting website
data to optimize performance, improve user experience, and achieve
business goals.
-​ The steps in the Web Analytics Process are
➔​D – Data Collection: Collects raw data using tracking tools like Google
Analytics, Adobe Analytics, etc. Example: Page views, bounce rate, session
duration.
➔​A – Analysis: Converts raw data into meaningful insights. Identifies user
behavior patterns, traffic sources, and conversion rates.
➔​T – Tracking & Testing: Implements A/B Testing and heatmaps to optimize
user experience. Compares different webpage designs or call-to-action
buttons.
➔​A – Action & Optimization: Uses insights to improve website content, SEO,
marketing strategies, and user experience. Example: Enhancing site speed or
improving CTA buttons for better conversions.

16. State four significant N-Triples language.


-​ N-Triples is a line-based, plain-text format used for storing and exchanging
RDF (Resource Description Framework) data. It represents data as
subject-predicate-object triples.
-​ The four significant N-Triples Languages:
➔​RDF (Resource Description Framework) – The foundation for
representing structured information on the web.
➔​OWL (Web Ontology Language) – Used for defining and reasoning
about ontologies in the Semantic Web.
➔​SPARQL (SPARQL Protocol and RDF Query Language) – A query
language for retrieving and manipulating RDF data.
➔​RDFS (RDF Schema) – Provides a basic vocabulary for defining
classes and properties in RDF.

17. Discuss any 5 built-in helper functions in AngularJS

-​ AngularJS provides several helper functions to simplify common tasks like


string manipulation, type checking, and data handling. Here are five
important ones:
I.​ angular.isArray(): It checks if the value is an array and returns true if
the value is an array, otherwise false
Example:

-​ angular.isObject(): It checks if a value is an object excluding


null. It returns true for objects, false for primitive values
-​ Example:

-​ angular.copy(): Creates a deep copy of an object or array. It is


useful for cloning objects without modifying the original

Example:

-​ angular.toJson(): It converts a JavaScript object into a JSON string and helps


in data storage and transmission.
-​ Example:
18. Discuss definite and indefinite loops with suitable examples in Typescript.

-​ Loops are used to execute a block of code repeatedly. They can be


categorized as:
-​ Definite Loops – Executes a known number of times. It runs for a predefined
number of times. For example for and for-of loops

The output of the above example is:

-​ Indefinite Loops – Executes until a condition is met. It runs until a condition


is false.The loop depends on count, which can change dynamically. The
number of iterations is not fixed at compile time. Examples : while and
do-while loops.
-​ The output is:

19. Explain an arrow function in TypeScript

-​ An arrow function is a shorthand syntax for writing functions in TypeScript.


It uses the => (arrow) symbol and provides a concise way to write functions,
especially for callbacks and one-liners.
-​ The Key Benefits of Arrow Functions are Shorter syntax, No separate this
binding and useful for callbacks, array methods (map, filter, etc)
-​ The syntax for arrow function in typescript is:

-​ For multiple lines


-​ Example1: Basic Arrow Functions: This is shorter and more readable than
the function keyword. It has implicit return for single-line expressions

-​ Example 2: Arrow Functions with Multiple Parameters

-​ Example 3: Arrow Functions with this Binding: Unlike traditional functions,


arrow functions do not bind their own this; instead, they inherit this
from their surrounding scope. Arrow functions preserve this context, making
them useful inside classes and event handlers
20. Explain Semantic Web Stack

-​ The Semantic Web Stack, also known as the Semantic Web Layer Cake, is a
layered architecture proposed by Tim Berners-Lee.
-​ It defines technologies that help the web understand, interpret, and process
data intelligently by adding meaning to information.
➔​U - URI & Unicode: Uniform Resource Identifier (URI) provides unique
addresses for web resources. Unicode ensures text is represented
consistently across different platforms.
➔​R - RDF (Resource Description Framework): A data model for representing
structured information using triples (Subject-Predicate-Object).
➔​O - Ontology (OWL - Web Ontology Language): Defines relationships
between data for reasoning and logical inferences. Helps machines
understand concepts like categories, properties, and rules.
➔​L - Logic & Rules (RIF, SWRL): Enables automated reasoning by applying
logical rules to data. Example: If a person is a student, they get a discount.
➔​ L - Linked Data (SPARQL): SPARQL (Query Language) retrieves data
from RDF databases. Helps in interconnecting datasets across different
domains.
➔​E - Encryption & Trust (Digital Signatures, Blockchain): Ensures data
security and authenticity with cryptographic methods.Prevents data
manipulation and fake information.
➔​D - Data Representation (XML, JSON-LD, Microdata): Formats like XML,
JSON-LD, and Microdata help structure data for web processing.

21. Explain Modules in TypeScript with example

-​ A module in TypeScript is a way to organize and reuse code by dividing it


into separate files. Modules help in maintaining clean, scalable, and
maintainable code.
-​ Modules are used for: Code Reusability, Encapsulation, Better
Maintainability and Improves Collaboration
-​ The Types of Modules in TypeScript are:
➔​Internal Modules (Namespaces): Used for grouping related code
within the same file
➔​External Modules (ES Modules): Uses import and export to share
code between files
-​ Example : Creating and Using Modules:
-​ STEP 1: Create a Module (mathFunction.ts)

-​ STEP 2: Import and Use Module (app.ts)


22. Short note on AngularJS Data Binding

-​ Data Binding in AngularJS is a mechanism that synchronizes the data


between the model (JavaScript variables) and the view (HTML UI)
automatically
-​ The Advantages of Data Binding in AngularJs are:
➔​Reduces boilerplate code: No need to manually update the DOM
➔​Improves responsiveness: UI updates dynamically as data changes
➔​Enhances user experience: Real-time updates without page reloads
-​ Types of Data Binding in AngularJS are:
1.​ One-Way Data Binding: Updates the view when the model changes
but not vice versa.
Example:

2.​ Two-Way Data Binding: Keeps the model and view in sync. Changes
in one automatically update the other.When the user types in the input,
the paragraph updates automatically.
Example:

23. What are expressions in angular JS


-​ Expressions in AngularJS are used to bind data to HTML
elements and perform simple calculations within the view. They
are enclosed in double curly braces {{ }} and execute like
JavaScript inside the HTML.
-​ It uses $scope variables and control structures are not allowed
in AngularJS expressions unlike JS Expression
-​ It runs inside the AngularJS framework
-​ The key features of AngularJS Expressions:
I.​ Execute Simple Operations - Perform mathematical and
logical operations
II.​ Bind Data to UI - Display dynamic values in the HTML
III.​ No control structures - Cannot use if-else, loops, or
function declarations.
-​ Example of expression in AngularJS:
24. Write a short note on:
1. Turtle:
-​ Turtle (Terse RDF Triple Language) is a popular RDF serialization
format used to represent structured data on the Semantic Web. It is
designed to be human-readable while maintaining the flexibility of
RDF data representation. Turtle follows the Subject-Predicate-Object
structure, making it easy to define relationships between different
resources.
-​ The key features of Turtle are:
I.​ Uses prefixes to shorten long URIs, improving readability.
II.​ Allows multiple statements for the same subject using ; and ,
to reduce repetition.
III.​ Supports data types and language tags for better metadata
representation.
IV.​ Can define lists and collections, which are not directly
supported in simpler RDF formats like N-Triples
-​ Examples:
2. N-Triples.
-​ N-Triples is a simple, line-based RDF format designed for storing and
exchanging RDF data in a machine-readable way. It strictly follows the
Subject-Predicate-Object structure, where each triple is written on a separate
line. Unlike Turtle, N-Triples does not support prefixes or shortcuts, making
it less readable but highly structured.
-​ The key features of N-Triples are:
I.​ Uses absolute URIs for clarity and consistency.
II.​ Each triple is stored on a single line, making it easy to process and
query.
III.​ Follows a strict syntax, which ensures data integrity in large-scale
applications.
IV.​ Commonly used for bulk data exchange and semantic web processing.
-​ Example of N-triples

25. What are Built-in directives in AngularJS


-​ AngularJS directives are special attributes or elements that extend
HTML functionality. Built-in directives help in data binding, event
handling, and DOM manipulation.
-​ The common built-in Directives in AngularJS are:
I.​ ng-app: Used for declaring an AngularJS application. This
directive defines the root element of an AngularJS application.
It tells AngularJS to start managing the page. Without ng-app,
AngularJS will not function
Example:

Here, AngularJS initializes the app when it detects ng-app

II.​ ng-model: It is used in two-way data binding. It binds an


HTML input element (like a textbox) to a variable in
AngularJS. It automatically gets updated.
Example:

As the user types in the input field, the text is dynamically updated in the <p> tag.

III.​ ng-bind: It is used in one way data binding. It binds a variable


to an HTML element, ensuring content updates dynamically.
Unlike {{}}, ng-bind prevents flickering during page load.
Example:

Here, the value of “message” is displayed inside <p> tag when defined in the
AngularJS controller
IV.​ Ng-init: It defines variables and initializes them within the
scope of an element
Example:

The variable count is set to 5, and it is displayed dynamically in the paragraph.

V.​ ng-repeat: This dynamically repeats an HTML element for each


item in an array
Example:

If items = [ ‘Apple’ , ‘Banana’ , ‘Cherry’], AngularJS will generate

VI.​ Ng-if: Displays an element only if the condition is true


Example:
The <p> tag appears only when isVisible is true. If isVisible is false,
the element won't be in the DOM.

VII.​ ng-show/ ng-hide: Shows or hides an element based on a


condition (unlike ng-if, the element remains in the DOM).

26. What are anonymous functions and arrow functions? Provide their syntax
in TypeScript.
-​ In TypeScript, both anonymous functions and arrow functions are used for
defining functions without explicitly naming them.
1.​ Anonymous functions: An anonymous function is a function without a
name, typically assigned to a variable or used as an argument to
another function.
Syntax:

-​ The key points


No Function name is specified, Often used in callbacks and event handlers
2.​ Arrow Functions: Arrow functions (=>) provide a more concise way
to write anonymous functions, commonly used in callbacks and array
operations.
Syntax:

-​ The key Points:


➔​Shorter syntax compared to anonymous functions.
➔​No need for the function keyword.
➔​Implicit return if the function body is a single expression.
➔​this inside arrow functions does not bind to the function but to the
surrounding scope.

You might also like