Question: I was told today that it's possible to invoke a function without parentheses. The only ways I could think of was using functions like [`apply`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply) or [`call`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call).

```
f.apply(this);
f.call(this);

```

But these require parentheses on `apply` and `call` leaving us at square one. I also considered the idea of passing the function to some sort of event handler such as [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout):

```
setTimeout(f, 500);

```

But then the question becomes "how do you invoke `setTimeout` without parentheses?"

So what's the solution to this riddle? How can you invoke a function in Javascript without using parentheses?

Answer: 
```
Array.constructor`alert\x28"invoke with whatever u want"\x29```;

```

Because Array.constructor is a `Function` object. When Function objects are invoked, they return a function which it's body is the arguments it got.
You can use an anonymous function.
It only works using pre-ES6 syntax, but still, it works.

Code:

```
//ES6+ (using const, still not using arrow functions)
const myFunc = (function(args){console.log("no parenthesis")})(args);

```

> 
> **and invoke it like this:**
> 
> 
> 

```js
myFunc;
// ^^^ no parenthesis in invocation, but you do have parenthesis in definition
// also note that the semicolon is optional if it is the only thing on the line

```

Before ES6:

```
var myNonES6Func = (function(args){console.log("Use var before ES6.")})(args);

```

> 
> **and invoke it like this**
> 
> 
> 

```
myNonES6Func;
// ^^^ same as the ES6 invocation.

```

```js
const es6_func = (function() {
    alert("ES6!")
})();
var before_es6_func = (function() {
    alert("Before ES6.")
})();
const es6 = () => {
    es6_func
}

function before_es6() {
    before_es6_func
}
```

```html
<button onclick="es6">ES6+</button>
<button onclick="before_es6">Before ES6</button>
```

> 
> **NOTE: Modern browsers do not seem to have this functionality anymore (it calls itself on page load, but when you called it normally, it would also work but you would have to add some counting code to keep it from running on page load) I did test it on Internet Explorer 11, and it seems to still work though, but Chrome, Firefox, and Edge do not work, it might've just been a bug in IE.**
> 
> 
>