When I first studied limits I have been taught that the limits tells us that the function will gets closer to some value when the domain of the function gets closer to some value.
then I studied the (ε-δ) definition and the (ε-δ) definition makes perfect sense with what I sudied before.
if you truly approaching a value then you are capable to make the function within a tolerance (ε) from the value you are approaching.
But this defintion works very well to me except in the constant function ,in the constant function the function stays the same all the time when x get closer and closer to some value the function doesn't gets closer and closer to any value,the function stays the same all the time so how we define the limit of a cosntant function?
Let $D\subset\Bbb R$, let $a\in\Bbb R$ such that every interval $(a-\varepsilon,a+\varepsilon)$ contains some point of $D$, let $f\colon D\longrightarrow\Bbb R$ be a function, and let $l\in\Bbb R$. We say that the limit of $f$ at $a$ is $l$ if$$(\forall\varepsilon>0)(\exists\delta>0)(\forall x\in D):|x-a|<\delta\implies\bigl|f(x)-l\bigr|<\varepsilon.$$If it turns out that $f$ is constant, that means that, for some $k\in\Bbb R$, $(\forall x\in D):f(x)=k$. But then the limit of $f$ at $a$ is $k$. In fact, if $\varepsilon>0$, then you can take any $\delta>0$, and then, if $x\in D$,$$|x-a|<\delta\implies\bigl|f(x)-k\bigr|=0<\varepsilon.$$
Concerning your informal approach at the end of your post, what happens is this: as $x$ gets closer and closer to $a$, $f(x)$ is already at $k$.