Well, you can use it to easily redefine a function:
function x() { alert('asdf'); }
eval(x.toString().replace('asdf','hello'));
x();
This will alert the string "hello" instead of the string "asdf".
This may be useful. On the other hand, self modifying code is often frowned upon because of the difficulty to maintain it...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…