I keep seeing this type of notation in the syntax section of the MDN guide for Javascript:
arr.indexOf(searchElement[, fromIndex = 0])
(from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)
I see in the first example on page that:
array.indexOf(9, 2); // 2
so I understand that the brackets aren't actually part of JS syntax. Also I am guessing that the "fromIndex = 0" is a way of indicating that the default value for fromIndex is 0.
My question is:
Is there a handy guide to the notation used by MDN for representing generalized JS syntax?
I'm a beginner so it's hard to decide what is actual JS syntax and what is merely a way of describing the syntax. Hope this makes sense!