Rewriting Cellular Automata C# to JS

Hey all. If you’ve gotten this far, thanks for reading. I’m a new programmer and I already know a little bit of JavaScript so I intend to use that as my development language for now. I’m trying to work my way through Sebastian Lague’s procedural generation tutorial and I’m having to rewrite the code as I go. I was doing fine until I ran into assigning values to the spaces in the matrices for the initial map roll.
Here’s my code:

var height: int;
var width: int;
var fill: float;

function mapGen(width, height) {
	var map = [width, height];
	mapFill(width, height);

function mapFill(width, height) {
	for (var x = 0; x <= width; x ++) {
		for (var y = 0; y <= height; y ++) {
			if (x == 0 || x == width - 1 || y == 0 || y == height - 1) {
			 	map[x,y] = 1;
			else {
				map[x,y] = (Math.random() < fill);

Unity keeps throwing errors at the map[x,y] lines. The error is BCE0048: Type “function(object, function): System.Collections.IEnumerable” does not support slicing. This is really irksome to me because the function it seems to be complaining about is apparently invisible. The syntax it gives me does not point me to any errors elsewhere in my code.

I haven’t worked it out past those errors. If you see anything else, feel free to point it out, but I don’t think I’ll have issues with anything else.

It looks like my error was in the matrix generator code. I wrote out a nested array function and it seems to be working fine now.

var matrix = [];
	for (x = 0; x < w; x++) {
    	matrix[x] = new Array(h);

Might need to fine-tune this but it got rid of the errors, so I’m happy.