function test(a = "ay", b = "bee") { console.log(`a = ${a}, b = ${b}`); } test(); // "a = ay, b = bee" test(1); // "a = 1, b = bee" test(undefined, 2); // "a = ay, b = 2" test(1, 2); // "a = 1, b = 2"
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter