GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — JavaScript-Lessons/ES6/Arrow_Functions/main.js at master · ranvirgorai/JavaScript-Lessons Expand file tree/ Copy pathmain.jsMore file actions 20 lines (16 loc) · 492 Bytes / Copy pathmain.jsFile metadata and controls20 lines (16 loc) · 492 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 "use strict"; function circleArea(r) { var PI = 3.14; return PI * r * r; } // we can now leave out the "function" keyword let circleArea1 = (r) => { const PI = 3.14; return PI * r * r; }; // parenthesis are optional is there is one parameter // we can also leave out the curly braces to return a value directly (without needing multiple statements) let circleArea2 = r => 3.14 * r * r; console.log(circleArea(7)); console.log(circleArea1(7)); console.log(circleArea2(7)); |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |