SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
Array Map Method
What is the map method?
What it does is go through
every element of the array,
and returns a new array.
What is the array map method?
Each element X at index i is
transformed/mapped to a
new element Y at index i of
the new array.
Illustration
1
2
3
1
4
6Map: 2*input
Array Map method be looking like?
let new_array = arr.map(function callback( currentValue[,
index[, array]]) {
// return element for new_array
}[, thisArg])
Other ways than map
● forEach
● for..of
● for
Other ways than map
forEach
const array = [1, 2, 3]
const new_array = []
array.forEach(x => new_array.push(x * x))
console.log(new_array) // [1, 4, 9]
Other ways than map
for..of
const array = [1, 2, 3]
const new_array = []
for ( let x of array)
new_array.push(x * x )
console.log(new_array) // [1, 4, 9]
Other ways than map
for
const array = [1, 2, 3]
const new_array = []
for ( let x = 0; x < array.length; x++)
new_array.push(array[x] * array[x])
console.log(new_array) // [1, 4, 9]
And finally Map
const array = [1, 2, 3]
const new_array = array.map( x => x * x)
console.log(new_array) // [1, 4, 9]
Calculate area of rectangles 1
const rectangles = [ { length: 2, width: 3 }, { length: 5, width: 2 }, { length:
10, width: 3 }]
const areaRectangles = rectangles.map( x => x.length * x.width)
console.log(areaRectangles) // [1, 4, 9]
Calculate area of rectangles 2
const rectangles = [ { length: 2, width: 3 }, { length: 5, width: 2 }, { length:
10, width: 3 }]
const areaRectangles = rectangles.map( x => x.area = x.length * x.width)
console.log(areaRectangles) // [ { length: 2, width: 3 , area: 6}, { length:
5, width: 2, area: 10 }, { length: 10, width: 3, area: 30 }]
Sample angular code
this.commandService .getCommands( {[queryName]: queryValue })
.subscribe((filtered: any) => {
this.commands = filtered.commands.map( (el: any) => {
return {
agent: el.user.displayName,
title: el.name,
client: el.sendername,
date: el.createdAt,
};
});
this.commandTableSource.load(this.commands);
});
Sample code React
<div className="gallery">
{ this.props.images.map((el, i) => <img alt={el.item} key={i} src={el.url} />)}
</div>
Questions
THE END

Weitere ähnliche Inhalte

Was ist angesagt?

January 7, 2014 function notation
January 7, 2014  function notationJanuary 7, 2014  function notation
January 7, 2014 function notationkhyps13
 
Function Operations
Function OperationsFunction Operations
Function Operationsswartzje
 
Binary space partition
Binary space partitionBinary space partition
Binary space partitionGopal kumar
 
Geo Spatial Plot using R
Geo Spatial Plot using R Geo Spatial Plot using R
Geo Spatial Plot using R Rupak Roy
 
Data visualization with multiple groups using ggplot2
Data visualization with multiple groups using ggplot2Data visualization with multiple groups using ggplot2
Data visualization with multiple groups using ggplot2Rupak Roy
 
4 2 operations on functions
4 2 operations on functions4 2 operations on functions
4 2 operations on functionshisema01
 
Md2k 0219 shang
Md2k 0219 shangMd2k 0219 shang
Md2k 0219 shangBBKuhn
 
Operations With Functions May 25 2009
Operations With Functions May 25 2009Operations With Functions May 25 2009
Operations With Functions May 25 2009ingroy
 
Ee693 sept2014quizgt2
Ee693 sept2014quizgt2Ee693 sept2014quizgt2
Ee693 sept2014quizgt2Gopi Saiteja
 
Ee693 sept2014quizgt1
Ee693 sept2014quizgt1Ee693 sept2014quizgt1
Ee693 sept2014quizgt1Gopi Saiteja
 
Day 2 examples u8f13
Day 2 examples u8f13Day 2 examples u8f13
Day 2 examples u8f13jchartiersjsd
 
Plotting position and velocity
Plotting position and velocityPlotting position and velocity
Plotting position and velocityabidraza88
 
7.3 power functions and function operations
7.3 power functions and function operations7.3 power functions and function operations
7.3 power functions and function operationshisema01
 

Was ist angesagt? (18)

Py lecture5 python plots
Py lecture5 python plotsPy lecture5 python plots
Py lecture5 python plots
 
AP Calculus 1984 FRQs
AP Calculus 1984 FRQsAP Calculus 1984 FRQs
AP Calculus 1984 FRQs
 
January 7, 2014 function notation
January 7, 2014  function notationJanuary 7, 2014  function notation
January 7, 2014 function notation
 
Function Operations
Function OperationsFunction Operations
Function Operations
 
Binary space partition
Binary space partitionBinary space partition
Binary space partition
 
Day 2a examples
Day 2a examplesDay 2a examples
Day 2a examples
 
Geo Spatial Plot using R
Geo Spatial Plot using R Geo Spatial Plot using R
Geo Spatial Plot using R
 
Data visualization with multiple groups using ggplot2
Data visualization with multiple groups using ggplot2Data visualization with multiple groups using ggplot2
Data visualization with multiple groups using ggplot2
 
Matlab graphics
Matlab graphicsMatlab graphics
Matlab graphics
 
4 2 operations on functions
4 2 operations on functions4 2 operations on functions
4 2 operations on functions
 
Md2k 0219 shang
Md2k 0219 shangMd2k 0219 shang
Md2k 0219 shang
 
Operations With Functions May 25 2009
Operations With Functions May 25 2009Operations With Functions May 25 2009
Operations With Functions May 25 2009
 
Ee693 sept2014quizgt2
Ee693 sept2014quizgt2Ee693 sept2014quizgt2
Ee693 sept2014quizgt2
 
Ee693 sept2014quizgt1
Ee693 sept2014quizgt1Ee693 sept2014quizgt1
Ee693 sept2014quizgt1
 
Day 2 examples u8f13
Day 2 examples u8f13Day 2 examples u8f13
Day 2 examples u8f13
 
Plotting position and velocity
Plotting position and velocityPlotting position and velocity
Plotting position and velocity
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
 
7.3 power functions and function operations
7.3 power functions and function operations7.3 power functions and function operations
7.3 power functions and function operations
 

Ähnlich wie Javascript Array map method

Multi dimensional arrays
Multi dimensional arraysMulti dimensional arrays
Multi dimensional arraysAseelhalees
 
NumPy_Broadcasting Data Science - Python.pptx
NumPy_Broadcasting Data Science - Python.pptxNumPy_Broadcasting Data Science - Python.pptx
NumPy_Broadcasting Data Science - Python.pptxJohnWilliam111370
 
CE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdfCE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdfUmarMustafa13
 
1) IntroductionThis practical work consists of developing
1) IntroductionThis practical work consists of developing1) IntroductionThis practical work consists of developing
1) IntroductionThis practical work consists of developingAbbyWhyte974
 
1) IntroductionThis practical work consists of developing
1) IntroductionThis practical work consists of developing1) IntroductionThis practical work consists of developing
1) IntroductionThis practical work consists of developingMartineMccracken314
 
Functions in advanced programming
Functions in advanced programmingFunctions in advanced programming
Functions in advanced programmingVisnuDharsini
 
Groovy collection api
Groovy collection apiGroovy collection api
Groovy collection apitrygvea
 
SaveI need help with this maze gui that I wrote in java, I am tryi.pdf
SaveI need help with this maze gui that I wrote in java, I am tryi.pdfSaveI need help with this maze gui that I wrote in java, I am tryi.pdf
SaveI need help with this maze gui that I wrote in java, I am tryi.pdfarihantstoneart
 
Matlab Overviiew 2
Matlab Overviiew 2Matlab Overviiew 2
Matlab Overviiew 2Nazim Naeem
 
Write a program that obtains the execution time of selection sort, bu.pdf
Write a program that obtains the execution time of selection sort, bu.pdfWrite a program that obtains the execution time of selection sort, bu.pdf
Write a program that obtains the execution time of selection sort, bu.pdfarri2009av
 
Introduction to matlab chapter2 by Dr.Bashir m. sa'ad.pdf
Introduction to matlab chapter2 by Dr.Bashir m. sa'ad.pdfIntroduction to matlab chapter2 by Dr.Bashir m. sa'ad.pdf
Introduction to matlab chapter2 by Dr.Bashir m. sa'ad.pdfYasirMuhammadlawan
 
Secretary_Game_With_Rejection.pdf
Secretary_Game_With_Rejection.pdfSecretary_Game_With_Rejection.pdf
Secretary_Game_With_Rejection.pdfAlexRoberts205071
 

Ähnlich wie Javascript Array map method (20)

Multi dimensional arrays
Multi dimensional arraysMulti dimensional arrays
Multi dimensional arrays
 
NumPy_Broadcasting Data Science - Python.pptx
NumPy_Broadcasting Data Science - Python.pptxNumPy_Broadcasting Data Science - Python.pptx
NumPy_Broadcasting Data Science - Python.pptx
 
CE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdfCE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdf
 
Scala Collections
Scala CollectionsScala Collections
Scala Collections
 
Scala collections
Scala collectionsScala collections
Scala collections
 
bobok
bobokbobok
bobok
 
1) IntroductionThis practical work consists of developing
1) IntroductionThis practical work consists of developing1) IntroductionThis practical work consists of developing
1) IntroductionThis practical work consists of developing
 
1) IntroductionThis practical work consists of developing
1) IntroductionThis practical work consists of developing1) IntroductionThis practical work consists of developing
1) IntroductionThis practical work consists of developing
 
Tutorial 2
Tutorial     2Tutorial     2
Tutorial 2
 
Functions in advanced programming
Functions in advanced programmingFunctions in advanced programming
Functions in advanced programming
 
Chap 6 c++
Chap 6 c++Chap 6 c++
Chap 6 c++
 
Array
ArrayArray
Array
 
Groovy collection api
Groovy collection apiGroovy collection api
Groovy collection api
 
Javascript
JavascriptJavascript
Javascript
 
SaveI need help with this maze gui that I wrote in java, I am tryi.pdf
SaveI need help with this maze gui that I wrote in java, I am tryi.pdfSaveI need help with this maze gui that I wrote in java, I am tryi.pdf
SaveI need help with this maze gui that I wrote in java, I am tryi.pdf
 
Matlab Overviiew 2
Matlab Overviiew 2Matlab Overviiew 2
Matlab Overviiew 2
 
Write a program that obtains the execution time of selection sort, bu.pdf
Write a program that obtains the execution time of selection sort, bu.pdfWrite a program that obtains the execution time of selection sort, bu.pdf
Write a program that obtains the execution time of selection sort, bu.pdf
 
Introduction to matlab chapter2 by Dr.Bashir m. sa'ad.pdf
Introduction to matlab chapter2 by Dr.Bashir m. sa'ad.pdfIntroduction to matlab chapter2 by Dr.Bashir m. sa'ad.pdf
Introduction to matlab chapter2 by Dr.Bashir m. sa'ad.pdf
 
Chap 6 c++
Chap 6 c++Chap 6 c++
Chap 6 c++
 
Secretary_Game_With_Rejection.pdf
Secretary_Game_With_Rejection.pdfSecretary_Game_With_Rejection.pdf
Secretary_Game_With_Rejection.pdf
 

Kürzlich hochgeladen

The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...software pro Development
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 

Kürzlich hochgeladen (20)

The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

Javascript Array map method

  • 2. What is the map method? What it does is go through every element of the array, and returns a new array.
  • 3. What is the array map method? Each element X at index i is transformed/mapped to a new element Y at index i of the new array.
  • 5. Array Map method be looking like? let new_array = arr.map(function callback( currentValue[, index[, array]]) { // return element for new_array }[, thisArg])
  • 6. Other ways than map ● forEach ● for..of ● for
  • 7. Other ways than map forEach const array = [1, 2, 3] const new_array = [] array.forEach(x => new_array.push(x * x)) console.log(new_array) // [1, 4, 9]
  • 8. Other ways than map for..of const array = [1, 2, 3] const new_array = [] for ( let x of array) new_array.push(x * x ) console.log(new_array) // [1, 4, 9]
  • 9. Other ways than map for const array = [1, 2, 3] const new_array = [] for ( let x = 0; x < array.length; x++) new_array.push(array[x] * array[x]) console.log(new_array) // [1, 4, 9]
  • 10. And finally Map const array = [1, 2, 3] const new_array = array.map( x => x * x) console.log(new_array) // [1, 4, 9]
  • 11. Calculate area of rectangles 1 const rectangles = [ { length: 2, width: 3 }, { length: 5, width: 2 }, { length: 10, width: 3 }] const areaRectangles = rectangles.map( x => x.length * x.width) console.log(areaRectangles) // [1, 4, 9]
  • 12. Calculate area of rectangles 2 const rectangles = [ { length: 2, width: 3 }, { length: 5, width: 2 }, { length: 10, width: 3 }] const areaRectangles = rectangles.map( x => x.area = x.length * x.width) console.log(areaRectangles) // [ { length: 2, width: 3 , area: 6}, { length: 5, width: 2, area: 10 }, { length: 10, width: 3, area: 30 }]
  • 13. Sample angular code this.commandService .getCommands( {[queryName]: queryValue }) .subscribe((filtered: any) => { this.commands = filtered.commands.map( (el: any) => { return { agent: el.user.displayName, title: el.name, client: el.sendername, date: el.createdAt, }; }); this.commandTableSource.load(this.commands); });
  • 14. Sample code React <div className="gallery"> { this.props.images.map((el, i) => <img alt={el.item} key={i} src={el.url} />)} </div>