Question: I have used 1 to 10 number stored in array as:

```
number = [[NSMutableArray alloc]initWithObjects:@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10", nil];

```

And used `arc4random` in this array as:

```
randomNumber = arc4random() % number.count; //random selected number

NSLog(@"%d",randomNumber);

```

In classname.h file 

```
 int randomNumber;
  NSMutableArray *number;

```

How to do `objectforindex` in this array

Answer: 
Try this:

```
function helloWorld () {
    return 'helloworld ';
}

var origHelloWorld = window.helloWorld;

window.helloWorld = function() {
    return origHelloWorld() + ' ' +'helloworld2';
}

alert( helloWorld() );

```
Using closures to avoid polluting the global namespace:

```
function helloWorld () {
    return 'helloworld ';
}

helloWorld = (function() {
    var original = window.helloWorld;
    return function () {
    return original() + ' helloworld2';
}})();

alert(helloWorld());

```