Example Analysis of a single statement in ES6
Editor to share with you the example analysis of a single ES6 sentence, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Single statement
In the age of ES6, statements for manipulating arrays will be more compact.
/ / find the maximum value in the array const max = (arr) = > Math.max (.arr); max ([123,321,32]) / / outputs: 321max / calculate the sum of the array const sum = (arr) = > arr.reduce ((a, b) = > (a + b), 0) sum ([1,2,3,4]) / / output: 10 is all the contents of the article "sample Analysis of ES6 single sentence". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!