![]() ![]() Finally developers can enjoy cleaner, more elegant and less workaround code □.īut again, don’t use it just because of its coolness or benefits. To my opinion, besides the short and more concise syntax, its most significant benefit is to provide a better solution regarding this scope binding. Arrow function is no exception and has mostly no significant improvement towards performance compared to classical function. ConclusionĪs stated in my other articles, most of ES6 new features are just syntactic sugar for function expression. Instead, we have class as proper replacement for classic function constructor. Lastly, arrow => function can’t be used as constructor. ![]() Hence it requires developers to be more careful in using it. Secondly, arrow => expression is pretty loosely-bind - aka in case there is a conflict with other operators, normally => will lose first. We are all used to return syntax when the function supposes to return something, aren’t we? ![]() In the first impression, it’s a bit difficult for developer who is not familiar with CoffeeScript to understand that this function will return a string. Too short can cause confusing, for instance let getMyName = () => `Maya Shavin` Thus being a shorter syntax is also, arguably, its disadvantage. ConsĪs some developers may argue, sometimes less code doesn’t mean more readable. What about the disadvantages/pitfalls? Is there any? Let’s find out. That’s pretty much the main benefits of ES6 Arrow function. This improvement surely simplifies function scope, prevents a lot of unwanted bugs □ and again, hereby reduces the amount of code needed for a workaround fix □.Īfter all, who wants to write (this) while you have a better alternative? In addition, an important benefit is the lexical binding of this - value is decided depends on its surrounding scope, not by how it is called. Function in JSĮvery function in JS (before ES6) can be declared with function operator syntax function HelloWorld()) Pen Tool - Bézier handles appear on click-and-drag when using the Pen Tool.As usual, let’s do a quick brief on old concepts about function in JS for the start.Images - File > Place Image… is restricted to compatible file types.Dark Mode - The column mapping for OmniOutliner importing adapts to Dark Mode.Artboards - Fixed a bug with artboards not applying to some objects only partially overlapping with the artboard.Dark Mode - Pasting plain text in Dark Mode does not set the text color to white.Touch Bar - The Convert Text to Shape option only appears when an entire object is selected.Stability - Fixed a crash that could occur when undoing shape combinations involving images.General - When no objects are selected on the canvas, the Delete key will not apply to the sidebar selection unless the sidebar has active focus.Shared Layers - Shared Layers can be deleted from individual canvases.Variables - Variables function correctly on Shared Layers.Text Tool - A click-and-drag with the Text Tool on the canvas creates a new text object of the corresponding width.Tables - Table objects set to use Fit shape to text retain that setting when their text is modified.Undo - When changes occur due to Auto layout, Undo will restore objects to the previous position.Canvases - Duplicating a canvas names the new canvas based on the original name.Selection Handles - The selection handles for a group of lines appears in the correct location.Selection Handles - When moving multiple objects at the same time via arrow keys or Inspector edits, the selection handles will follow the objects. ![]() Stability - Fixed a crash in the App Store version on receipt validation when AirPlay 2 is in use on devices with an ethernet port.Stencils - The Data Flow Diagram stencil added in 7.12 will be automatically installed on systems updating from a previous version if it has not yet been manually restored.Stability - Using the Style Brush no longer triggers a crash. ![]()
0 Comments
Leave a Reply. |