⊗jsSpMdIA 210 of 294 menu

Aliases on import in JavaScript

You can rename functions on import. This is done with the as command. For example, let's rename the root2 function to sqrt function:

import {root2 as sqrt, root3} from './math.js';

Let's check the code:

let res = sqrt(2) + root3(3); console.log(res);

When importing your module, rename the pow2 function to square and the pow3 function to cube.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline