Skip to content

Added snippet for Creating a function using constructor #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Create a function using Function constructor
How to create a function using constructor
  • Loading branch information
MadhuNimmo authored Oct 3, 2020
commit 4b04bd6d8dc3c9b0065d3a4cdd799f7746af6382
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
|33 | [replaceAll](#replaceAll)|
|34 | [Required Function Params](#Required-Function-Params)|
|35 | [Get input value as a number](#Get-input-value-as-a-number)|
|36 | [Creating a function using Function constructor](#Create-Function-Using-Constructor)|




Expand Down Expand Up @@ -753,4 +755,16 @@ function checkMyType(event){

}

```

**[⬆ Back to Top](#table-of-contents)**
### Create a function using Function constructor
```javascript
function bar() {
return new Function('return "x"');
};
var x = bar();
x();//returns x


```