Sorry for now using the most suitable technical words, but at the moment I’m experimenting with jQuery, and I seem to be repeating a certain function quite a lot, is there anyway to reference this function? Maybe by setting it as a variable or similar? Thanks
Share
Yes, in javascript functions are first class citizens – the following is perfectly legal:
Update
Based on your code snippet, you’d want your function to be declared like so:
Which would then be useable like so: