We have jQuery available, so a more succinct version would be:
```js
var newTake = $.grep(d, function(row) { row.username == username })[0].take