CodingTrain / CodingTrain/Suggestion-Box

tutorial on passing parameter in callback

Open
#1,425 0 comments 0 reactions 0 assignees View on GitHub
Tutorial
Dominant language
No language data
Stars
570
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Another tutorial I think students will greatly benefit from is being able to pass a parameter in a callback. I am able to teach this in the classroom but it becomes a tad difficult to explain this via slack at midnight to a student.

```
btn_roomGenerator.mousePressed(_ => {
generateRoom.call(this, randRoom);
console.log('generated room');
});
```

maybe this could be a tut on call(), apply(), and bind() ... ?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.