SlideShare a Scribd company logo
JAVASCRIPT-ARRAY
JavaScript - ARRAY
• When we use var, let we can stored only one
value at a time.
– var friend1 = ‘john’;
– var friend2 = ‘smith’;
– var friend3 = ‘peter’;
• When we feel like storing multiple values in one
variable then instead of var or let, we will use an
Array.
JavaScript - ARRAY
• var Names= [‘John’,’Smith’,’Peter’,’David’];
• First Element of an array known as Lower
Index/ Lower Boundary.
• Last Element of an array known as Upper
Index/ Upper Boundary.
JavaScript - ARRAY
What we will do
• Traversal of an Array
• How to insert, Add, Replace and Delete
Elements in Array(CRUD)
• Map(), Reduce(), filter()
Traversal in array
• if we want to get the single data at a time.
arrayVarName[indexNumber]
• Traverse the Last Element of an Array
arrayVarName[arrayVarName.length-1]
Loops to Traverse Array
• For loop
• For in loop
• For of loop
• forEach
Perform CRUD on Array
• Push()
– The push() method adds one or more elements to the
end of an array and returns the new length of the
array.
• Unshift()
– The unshift() method adds one or more elements to
the beginning of an array and returns the new length
of the array
Perform CRUD on Array
• Pop()
– The pop() method removes the last element from an
array and returns that element. This method changes
the length of the array
• Shift()
– The shift() method removes the first element from an
array and returns that removed element. This method
changes the length of the array.
Perform CRUD on Array
• Splice()
– The splice() method of Array changes the contents
of an array by removing or replacing existing
elements and/or adding new elements in place.
Perform CRUD on Array
• Splice()
– The General Syntax
splice(start)
splice(start, deleteCount)
splice(start, deleteCount, item0)
splice(start, deleteCount, item0, item1)
splice(start, deleteCount, item0, item1, /* …, */ itemN)
Perform CRUD on Array
• Splice(start): Parameters
– Start: Zero-based index at which to start changing
the array
– deleteCount : An integer indicating the number of
elements in the array to remove from start
– item0, …, itemN: The elements to add to the array,
beginning from start.
Task of the Day
1. Add Dec at the end of an array?
2. What is the return value of splice method?
3. update march to March (update)?
4. Delete June from an array?
const months = ['Jan', 'march', 'April', 'June', 'July'];
Map()
• Returns a new array containing the results of
calling a function on every element in this
array.
• It return new array without mutating the
original array
Map() vs forEach()
• The returning value
• Ability to chain other methods
• Mutability
Click here to read more
Example
• Find the square root of each element in an
array?
let arr = [25, 36, 49, 64, 81];
• Multiply each element by 2 and return only
those elements which are greater than 10?
let arr = [2, 3, 4, 6, 8];
Filter()
• The filter() method creates a new array with
all elements that pass the test implemented
by the provided function.
• It returns a new array containing only the
elements for which the function returns true
Example
• In the following array return only those
elements which are greater than 5?
const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
Map() vs filter()
• map() is used when you want to transform each
element of an array and create a new array with the
transformed values.
• filter() is used when you want to create a new array
that contains only the elements that meet a certain
condition.
• Keep in mind that both methods do not modify the
original array; they create new arrays based on the
transformation or filtering criteria.
Reduce()
• The reduce() method executes a reducer
function (that you provide) on each element
of the array, resulting in single output value.
array.reduce(function(accumulator,currentValue,currentIndex,array)
{
// Your reducer logic here
}, initialValue);
Task: Data Processing with Map,
Filter, and Reduce
• You have an array of objects representing
different products. Each object contains
information about the product's name, price,
and quantity. Your task is to perform various
operations on this data using the map(),
filter(), and reduce() methods.
Array of an Object
const products = [
{ name: 'Laptop', price: 1000, quantity: 5 },
{ name: 'Phone', price: 600, quantity: 10 },
{ name: 'Tablet', price: 300, quantity: 7 },
{ name: 'Headphones', price: 150, quantity: 20 },
{ name: 'Monitor', price: 300, quantity: 3 }
];
Array of an Object
• Task 1: Use map() to create an array of product
names.
• Task 2: Use filter() to get products with a price
greater than $200
• Task 3: Use reduce() to calculate the total value
of all products
• Task 4 : Return only Names of the product with
price greater than $200.
THANKS

More Related Content

Similar to javascript-Array.ppsx

Collection and framework
Collection and frameworkCollection and framework
Collection and framework
SARAVANAN GOPALAKRISHNAN
 
Array properties
Array propertiesArray properties
Array properties
Shravan Sharma
 
Arrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | EdurekaArrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | Edureka
Edureka!
 
arrays in c# including Classes handling arrays
arrays in c#  including Classes handling arraysarrays in c#  including Classes handling arrays
arrays in c# including Classes handling arrays
JayanthiM19
 
22.ppt
22.ppt22.ppt
Underscore.js
Underscore.jsUnderscore.js
Underscore.js
timourian
 
Java script advance-auroskills (2)
Java script advance-auroskills (2)Java script advance-auroskills (2)
Java script advance-auroskills (2)
BoneyGawande
 
Array
ArrayArray
Array
PRN USM
 
Arrays.pptx
Arrays.pptxArrays.pptx
Arrays.pptx
Epsiba1
 
CP PPT_Unit IV computer programming in c.pdf
CP PPT_Unit IV computer programming in c.pdfCP PPT_Unit IV computer programming in c.pdf
CP PPT_Unit IV computer programming in c.pdf
saneshgamerz
 
4. Array.pptx
4. Array.pptx4. Array.pptx
4. Array.pptx
RahikAhmed
 
0-Slot18-19-20-ContiguousStorage.pdf
0-Slot18-19-20-ContiguousStorage.pdf0-Slot18-19-20-ContiguousStorage.pdf
0-Slot18-19-20-ContiguousStorage.pdf
ssusere19c741
 
Unit 2 dsa LINEAR DATA STRUCTURE
Unit 2 dsa LINEAR DATA STRUCTUREUnit 2 dsa LINEAR DATA STRUCTURE
DS Unit 1.pptx
DS Unit 1.pptxDS Unit 1.pptx
DS Unit 1.pptx
chin463670
 
ACP-arrays.pptx
ACP-arrays.pptxACP-arrays.pptx
ACP-arrays.pptx
MuhammadSubtain9
 
What are arrays in java script
What are arrays in java scriptWhat are arrays in java script
What are arrays in java script
Miguel Silva Loureiro
 
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
NUMPY-2.pptx
NUMPY-2.pptxNUMPY-2.pptx
NUMPY-2.pptx
MahendraVusa
 
Operators in mule dataweave
Operators in mule dataweaveOperators in mule dataweave
Operators in mule dataweave
Ramakrishna kapa
 
Ist year Msc,2nd sem module1
Ist year Msc,2nd sem module1Ist year Msc,2nd sem module1
Ist year Msc,2nd sem module1
blessyboban92
 

Similar to javascript-Array.ppsx (20)

Collection and framework
Collection and frameworkCollection and framework
Collection and framework
 
Array properties
Array propertiesArray properties
Array properties
 
Arrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | EdurekaArrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | Edureka
 
arrays in c# including Classes handling arrays
arrays in c#  including Classes handling arraysarrays in c#  including Classes handling arrays
arrays in c# including Classes handling arrays
 
22.ppt
22.ppt22.ppt
22.ppt
 
Underscore.js
Underscore.jsUnderscore.js
Underscore.js
 
Java script advance-auroskills (2)
Java script advance-auroskills (2)Java script advance-auroskills (2)
Java script advance-auroskills (2)
 
Array
ArrayArray
Array
 
Arrays.pptx
Arrays.pptxArrays.pptx
Arrays.pptx
 
CP PPT_Unit IV computer programming in c.pdf
CP PPT_Unit IV computer programming in c.pdfCP PPT_Unit IV computer programming in c.pdf
CP PPT_Unit IV computer programming in c.pdf
 
4. Array.pptx
4. Array.pptx4. Array.pptx
4. Array.pptx
 
0-Slot18-19-20-ContiguousStorage.pdf
0-Slot18-19-20-ContiguousStorage.pdf0-Slot18-19-20-ContiguousStorage.pdf
0-Slot18-19-20-ContiguousStorage.pdf
 
Unit 2 dsa LINEAR DATA STRUCTURE
Unit 2 dsa LINEAR DATA STRUCTUREUnit 2 dsa LINEAR DATA STRUCTURE
Unit 2 dsa LINEAR DATA STRUCTURE
 
DS Unit 1.pptx
DS Unit 1.pptxDS Unit 1.pptx
DS Unit 1.pptx
 
ACP-arrays.pptx
ACP-arrays.pptxACP-arrays.pptx
ACP-arrays.pptx
 
What are arrays in java script
What are arrays in java scriptWhat are arrays in java script
What are arrays in java script
 
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
ARRAYS.pptx
 
NUMPY-2.pptx
NUMPY-2.pptxNUMPY-2.pptx
NUMPY-2.pptx
 
Operators in mule dataweave
Operators in mule dataweaveOperators in mule dataweave
Operators in mule dataweave
 
Ist year Msc,2nd sem module1
Ist year Msc,2nd sem module1Ist year Msc,2nd sem module1
Ist year Msc,2nd sem module1
 

Recently uploaded

06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
74nqk8xf
 
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
74nqk8xf
 
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataPredictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Kiwi Creative
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
bopyb
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
Social Samosa
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
Sm321
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
Walaa Eldin Moustafa
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
rwarrenll
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
jitskeb
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
manishkhaire30
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
Sachin Paul
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
nuttdpt
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
AlessioFois2
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
Timothy Spann
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Aggregage
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
Lars Albertsson
 
Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
Bill641377
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
g4dpvqap0
 

Recently uploaded (20)

06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
一比一原版(Coventry毕业证书)考文垂大学毕业证如何办理
 
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
一比一原版(牛布毕业证书)牛津布鲁克斯大学毕业证如何办理
 
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging DataPredictably Improve Your B2B Tech Company's Performance by Leveraging Data
Predictably Improve Your B2B Tech Company's Performance by Leveraging Data
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
4th Modern Marketing Reckoner by MMA Global India & Group M: 60+ experts on W...
 
Challenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more importantChallenges of Nation Building-1.pptx with more important
Challenges of Nation Building-1.pptx with more important
 
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data LakeViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
ViewShift: Hassle-free Dynamic Policy Enforcement for Every Data Lake
 
My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.My burning issue is homelessness K.C.M.O.
My burning issue is homelessness K.C.M.O.
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
 
Learn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queriesLearn SQL from basic queries to Advance queries
Learn SQL from basic queries to Advance queries
 
Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
 
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
06-04-2024 - NYC Tech Week - Discussion on Vector Databases, Unstructured Dat...
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
 
End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024End-to-end pipeline agility - Berlin Buzzwords 2024
End-to-end pipeline agility - Berlin Buzzwords 2024
 
Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
 
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
一比一原版(爱大毕业证书)爱丁堡大学毕业证如何办理
 

javascript-Array.ppsx

  • 2. JavaScript - ARRAY • When we use var, let we can stored only one value at a time. – var friend1 = ‘john’; – var friend2 = ‘smith’; – var friend3 = ‘peter’; • When we feel like storing multiple values in one variable then instead of var or let, we will use an Array.
  • 3. JavaScript - ARRAY • var Names= [‘John’,’Smith’,’Peter’,’David’]; • First Element of an array known as Lower Index/ Lower Boundary. • Last Element of an array known as Upper Index/ Upper Boundary.
  • 5. What we will do • Traversal of an Array • How to insert, Add, Replace and Delete Elements in Array(CRUD) • Map(), Reduce(), filter()
  • 6. Traversal in array • if we want to get the single data at a time. arrayVarName[indexNumber] • Traverse the Last Element of an Array arrayVarName[arrayVarName.length-1]
  • 7. Loops to Traverse Array • For loop • For in loop • For of loop • forEach
  • 8. Perform CRUD on Array • Push() – The push() method adds one or more elements to the end of an array and returns the new length of the array. • Unshift() – The unshift() method adds one or more elements to the beginning of an array and returns the new length of the array
  • 9. Perform CRUD on Array • Pop() – The pop() method removes the last element from an array and returns that element. This method changes the length of the array • Shift() – The shift() method removes the first element from an array and returns that removed element. This method changes the length of the array.
  • 10. Perform CRUD on Array • Splice() – The splice() method of Array changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.
  • 11. Perform CRUD on Array • Splice() – The General Syntax splice(start) splice(start, deleteCount) splice(start, deleteCount, item0) splice(start, deleteCount, item0, item1) splice(start, deleteCount, item0, item1, /* …, */ itemN)
  • 12. Perform CRUD on Array • Splice(start): Parameters – Start: Zero-based index at which to start changing the array – deleteCount : An integer indicating the number of elements in the array to remove from start – item0, …, itemN: The elements to add to the array, beginning from start.
  • 13. Task of the Day 1. Add Dec at the end of an array? 2. What is the return value of splice method? 3. update march to March (update)? 4. Delete June from an array? const months = ['Jan', 'march', 'April', 'June', 'July'];
  • 14. Map() • Returns a new array containing the results of calling a function on every element in this array. • It return new array without mutating the original array
  • 15. Map() vs forEach() • The returning value • Ability to chain other methods • Mutability Click here to read more
  • 16. Example • Find the square root of each element in an array? let arr = [25, 36, 49, 64, 81]; • Multiply each element by 2 and return only those elements which are greater than 10? let arr = [2, 3, 4, 6, 8];
  • 17. Filter() • The filter() method creates a new array with all elements that pass the test implemented by the provided function. • It returns a new array containing only the elements for which the function returns true
  • 18. Example • In the following array return only those elements which are greater than 5? const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  • 19. Map() vs filter() • map() is used when you want to transform each element of an array and create a new array with the transformed values. • filter() is used when you want to create a new array that contains only the elements that meet a certain condition. • Keep in mind that both methods do not modify the original array; they create new arrays based on the transformation or filtering criteria.
  • 20. Reduce() • The reduce() method executes a reducer function (that you provide) on each element of the array, resulting in single output value. array.reduce(function(accumulator,currentValue,currentIndex,array) { // Your reducer logic here }, initialValue);
  • 21. Task: Data Processing with Map, Filter, and Reduce • You have an array of objects representing different products. Each object contains information about the product's name, price, and quantity. Your task is to perform various operations on this data using the map(), filter(), and reduce() methods.
  • 22. Array of an Object const products = [ { name: 'Laptop', price: 1000, quantity: 5 }, { name: 'Phone', price: 600, quantity: 10 }, { name: 'Tablet', price: 300, quantity: 7 }, { name: 'Headphones', price: 150, quantity: 20 }, { name: 'Monitor', price: 300, quantity: 3 } ];
  • 23. Array of an Object • Task 1: Use map() to create an array of product names. • Task 2: Use filter() to get products with a price greater than $200 • Task 3: Use reduce() to calculate the total value of all products • Task 4 : Return only Names of the product with price greater than $200.