Created
May 12, 2020 22:14
-
-
Save ramazankanbur/6deb8a173ff39fe7b793fda9a235c386 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //ES5 | |
| var a = 3; | |
| var b = 5; | |
| var flag = true; | |
| var flagResult = flag === true ? ',\nBingoo' : ''; | |
| var result1 = a + ' * ' + b + ' = ' + a * b + "'dir" + flagResult; | |
| console.log(result1); | |
| //output | |
| // 3 * 5 = 15'dir, | |
| // Bingoo | |
| //ES6 | |
| var result2 = `${a} * ${b} = ${a * b}'dir | |
| ${flag === true ? 'Bingoo' : ''}`; | |
| console.log(result2); | |
| //output | |
| // 3 * 5 = 15'dir, | |
| // Bingoo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment