quick question. I have a series of the same if statements which I’m using in multiple functions. To avoid repetition I thought of putting these statements into their own function and then calling the function in the other functions.
This is just a simple example, but nothing is happening. What am I doing wrong?
Thank you for any help!
function notify() {
if (a == "one") {
var c = "one";
}
if (b == "two") {
var c = "two";
}
}
$(function() {
notify();
});
$(function() {
notify();
});