Explain the concept of operator precedence in JavaScript.

Operator precedence in JavaScript refers to the rules that determine the order in which different operators are evaluated in an expression. When an expression contains multiple operators, operator precedence defines the grouping and sequencing of these operations. Operators with higher precedence are evaluated before those with lower precedence.

For example, in the expression `a + b * c`, the `*` (multiplication) operator has higher precedence than the `+` (addition) operator. Therefore, `b * c` is evaluated first, and then the result is added to `a`.

Here are some key concepts related to operator precedence:

1. Higher Precedence: Operators with higher precedence are evaluated before operators with lower precedence. For example, multiplication (`*`) has higher precedence than addition (`+`).

2. Parentheses: Parentheses `( )` can be used to explicitly specify the order of evaluation. Expressions inside parentheses are evaluated first, regardless of the operators' precedence.


   let result = (a + b) * c;


   Here, `a + b` is evaluated first due to the parentheses.

3. Associativity: When operators of the same precedence appear in an expression without parentheses, associativity determines the order of evaluation. Associativity can be left-to-right or right-to-left.

   let result = a * b * c;


Here, if `*` has left-to-right associativity, `a * b` is evaluated first, and then the result is multiplied by `c`.

Operator precedence is crucial for understanding and predicting how expressions are evaluated. The Mozilla Developer Network (MDN) provides a comprehensive list of operator precedence in JavaScript, which can be referenced when dealing with complex expressions: [MDN Operator Precedence](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence).

It's essential to be aware of operator precedence to write code that behaves as intended and to use parentheses when needed to clarify the order of evaluation.