locaStorage and javascript loop
===

I have a problem with my little app, 
You can see it here : http://jsfiddle.net/47bV8/

My problem is : I enter some notes then when I "clear All", and i re-enter a note, 
 the console returns me lsReturn == null on the refresh .

I understand Why but can't see how to solve the problem.

In fact the value of my 'var i' is not 0 after clear all (it's value is the last note i've entered so 5 if i've entered 5 notes), so when i re enter a note it's task-6, so on the refresh my first loop fails...


I tried to set var i = 0 after the localstorage.clear but it doesn't worK...
