\( \definecolor{colordef}{RGB}{249,49,84} \definecolor{colorprop}{RGB}{18,102,241} \)
The table of values is given below:
\(x\) \(-2\) \(0\) \(1\) \(3\) \(4\)
\(g(x)\) \(3\) \(0\) \(1\) \(2\) \(-1\)
Find \(x\) such that \(g(x)=2\).
\(x=\)