n'Abend!
~~~javascript
var x = this.toString();
var z = x.split('');
var quer = 0;
for(var i = 0; i < z.length; i++) quer += Number(z[i]);
return quer;
Oder noch etwas kürzer und damit übersichtlicher:
~~~javascript
var z = this.toString().split('');
for (var i=0, var quer=0; i<z.length; quer+=Number(z[i++]));
return (quer);
Schönen Abend noch,
Martin
--
You say, it cannot be love if it isn't for ever.
But let me tell you: Sometimes, a single scene can be more to remember than the whole play.
You say, it cannot be love if it isn't for ever.
But let me tell you: Sometimes, a single scene can be more to remember than the whole play.