Skip to content

Instantly share code, notes, and snippets.

@ramazankanbur
Created May 12, 2020 22:14
Show Gist options
  • Save ramazankanbur/6deb8a173ff39fe7b793fda9a235c386 to your computer and use it in GitHub Desktop.
Save ramazankanbur/6deb8a173ff39fe7b793fda9a235c386 to your computer and use it in GitHub Desktop.
//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