can someone explain to me how I am to write a JS that uses methods calls rather than function calls. I am trying to write a script that uses an array of data and I want to display it according to one of several buttons a user presses.
what I mean is… if a user presses button A, the script will display all of the records. if the user presses button B, the script will display records in a range, if C — by a certain refernce, like a name in the record, etc etc
I dont know if I am clear in my description.
I need functions, for sure, but I need to write a new function to support each button. Each function supports a method like this to define a new method (inside the constructor function):
this.toString = hlToString;
The name of the method is ‘toString’. ‘hlToString’ is the name of the function.
I am trying to make a form where users click certain buttons to get results to display in the text area depending on clicks.