I am trying to convert a name string 'talhakhan' to 'TaLhaKhAn'. I can loop through the entire variable but I am facing issue in assignment. Please check my code:

```js
var name = 'talhakhan';
var counter = true;
for (var e = 0; e < name.length; e++) {
  if (counter)
    name.charAt(e) = name.charAt(e).toUpperCase();
  else
    name.charAt(e) = name.charAt(e).toLowerCase();
  counter = false;
}
```

error:

> 
> VM704:1 Uncaught ReferenceError: Invalid left-hand side in assignment
> at :1:11
> 
> 
>