declare generic for function js code example Example: how to make a generic variable in javascript var x = 1; var y = 1; if (x == y) { x = x + 1 }