Question: Trying to implement something like this:

```
arr = (1..10)

arr[2,5] = [2,3,4,5]
arr(2,5] = [3,4,5]
arr[2,5) = [2,3,4]
arr(2,5) = [3,4]

```

Well, we need to override four bracket opreators: [], [), (], ()

Any ideas?

It's called "Including or excluding" in mathematics. <https://en.wikipedia.org/wiki/Interval_(mathematics)#Including_or_excluding_endpoints>

Answer: 
I am way late and a dollar short, but here is another solution. I was looking for a quick answer before stumbling across it Intellisense. It sounds like you are looking for ClearScript's "Invoke" method:

Given that you might have a JavaScript function like:

```
function calculation(a) {
    var b = a[0];
    var c = a[1];
    var d = a[2];
    var e = a[3];

    return `{{ one: ${(b + c)}, two: ${(d + e)} }}`;
};

```

That you wish to call from C# with an array of ints:

```
var rtnstr = engine.Invoke("calculation", new int[] { 1, 2, 3, 4, 5 });

```

Possible bug in ClearScript 5.6: It does not seem to like function variables. I originally tried to declare the function as:

```
const calculation = (a) => {
    var b = a[0];
    var c = a[1];
    var d = a[2];
    var e = a[3];

    return `{{ one: ${(b + c)}, two: ${(d + e)} }}`;
};

```

But I received an exception "Method or property not found". Declaring as a plain old function in the global scope works though.
Note that I haven't worked on this and am trying to connect the dots using documentation.

```
using Microsoft.ClearScript.V8;

public static void Main(string[] args)
{
    var engine = new V8ScriptEngine();
    engine.AddHostObject("a", args);    // it looks like a is the name of the variable that wil be used by script to refer to host object which is args in this case

    engine.Execute(".... your javascript code ....");
    var returnStr = engine.Script.rtnstr;
}   

```