Here cm refers to an editor... and whenver user types in .on('changes') will get called..
what i wanted to achieve is execute a function detect only when user halts for a typing.
For this i have used setTimeout();
This is the first time i am using such a function. Want to know if there are any alternatives better way to achieve the same. are there any pros or cons of using the way i am doing it ?