How ES6 exchanges elements
This article mainly shows you "ES6 how to exchange elements", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "ES6 how to exchange elements" this article.
Exchange element
Using array deconstruction to realize the exchange of values
Let a = 'world', b =' hello' [a, b] = [b, a] console.log (a) /-> helloconsole.log (b) / /-> world above is all the content of this article "how ES6 exchanges elements". 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!