Coding challenge

Write some code that will take in a variable $x$ and $n$, and will return the $n^{th}$ digit of $x$ (from the right). As test, if $x=12345$ and $n=2$, your code should return a $4$.

Type your code here:


Lua reference

See your results here: