onlycode.org

javascript
jquery
html
angularjs
css
node.js
ajax
html5
php
json
arrays
google-chrome
dom
regex
reactjs
ecmascript-6
javascript-events

your's history:
function without parenth...

Function without parentheses returns a weird output, just only code

javascript

edit
function say(something) {
    return something;
}
console.log(say`anything`);
function tag(strings) {
  console.log(strings.raw[0]);
}

tag`string text line 1 \n string text line 2`;
// logs "string text line 1 \n string text line 2" ,
// including the two characters '\' and 'n'

29
Nguyễn Thanh Tú, 30.09.2018 05:09




edit
[
  "My name is ",
  "!"
] Reza
function myTag(strings, personExp, ageExp) {
  var str0 = strings[0]; // "That "
  var str1 = strings[1]; // " is a "

  var ageStr;
  if (ageExp > 99){
    ageStr = 'centenarian';
  } else {
    ageStr = 'youngster';
  }

  // We can even return a string built using a template literal
  return `${str0}${personExp}${str1}${ageStr}`;
}

var person = 'Mike';
var age = 28;
var output = myTag`That ${ person } is a ${ age }`;

28
Rafael, 30.09.2018 05:10




edit
 function say(strings, something) { 
    return strings[0] + "Mr. " + something +"!"; 
} 

let name = `Reza`; 
console.log(say `My name is ${name}`);    

26
Calvin, 30.09.2018 05:51



edit
console.log(say `My name is`, name, '!'); /* I don't see `${name}` here */

10
Arvind, 30.09.2018 05:48

Add your just only code

your name:    



If you need full text click here

Some similar links Function without parentheses returns a weird output ↓:
Why is this function wrapped in parentheses, followed by parentheses? [duplicate]

Invoking a function without parentheses

Two sets of parentheses after function call

Calling a function in JavaScript without parentheses



This project is created for those who just need only code, wihout maaaaaaaaaaany words.