Sun Dial Menu
Arrow functions
Menu Arrow Functions
 

Arrow functions

Arrow Functions are a short-form technique of expressing JavaScript Functions. The MDN website discusses them in great detail and the limitations of their use.

The example that I give below also contains a "Template Literal" and shows its use in my example of "Bubbling and Capturing" of events. The useage of the Arrow Function syntax in this case was not particularly helpful as it only was used to add an event to an element using the addEventListener() Method.

I consider the use of an Arrow Function and its syntax as an advanced JavaScript technique and there are far better places on the Internet that explain their use.

I came across this when looking at Event Bubbling and Capture - the use of the useCapture parameter in the addEventListener() Method

How I saw this used first - or actually noticed it.

    elem.addEventListener("click", e => alert(`Capturing: ${elem.tagName}`), true);

The JavaScript statement above also uses a Template Literal - this is enclosed using the ` character (grave accent - to the left of the 1 on my keyboard)

`Capturing: ${elem.tagName}`
Top

Links

External Links Disabled.

tempusfugit.me.uk is a non-commercial website. No payment or benefit is gained by the placement of links toother websites.

The External link is disabled to on this page, please visit other pages

Unlike most genealogical research websites tempusfugit.me.uk does not attempt to get you to "sign-up" when you click on one of their links.

This Wikipedia link is disabled.

The link on Wikipedia was to:

External Links Disabled.

tempusfugit.me.uk is a non-commercial website. No payment or benefit is gained by the placement of links to other websites.

The External link is disabled to on this page, please visit other pages

Top

External Links - references

Site design by Tempusfugit Web Design -