2015年5月26日 星期二

Understanding ECMAScript 6: Template Strings (#2)

Welcome to the second a part of my collection about ECMAScript 6! One in every of my favourite new net requirements Microsoft Edge, the brand new browser rendering engine we’re creating at Microsoft, is the in depth help it provides for ECMAScript 6. So I wrote this collection to stroll you thru a number of the cool issues you are able to do with ECMAScript 6 when writing giant purposes for the online. Within the first installment, I coated Class and Inheritance. On this article, I am going to give attention to template strings based mostly on my private expertise creating embedded expressions. Resolving the Line Return Drawback When engaged on babylon.js, I’ve to cope with shaders code which might be seen, for the sake of comprehension, like an enormous bunch of textual content (which appears like C). You’ll find an instance right here. The issue when coping with lengthy-sized textual content in JavaScript is the road return. What number of occasions did you write this type of factor? 1 2 three four 5 6 7 var myTooLongString = “A very long time in the past, in a galaxy far,” + “distant….” + “It’s a interval of civil conflict.” + “Insurgent spaceships, putting” + “from a hidden base, have gained” + “their first victory towards” + […]

沒有留言: