Answers.Body: <p>After Effects (as of version 16, released 2020) uses the V8 Javascript engine to interpret expressions. This is the same as used in many web browsers, such as Chrome.</p>
  <p>It's pretty easy to test if it follows BODMAS (The <strong>O</strong> in which stands for <strong>Order</strong> BTW). On a text layer <kbd>alt / opt</kbd>-click the stop watch for text source and paste this:</p>
  <pre><code>let brackets = 2 * (1 + 1);
  let order = 1 + Math.pow(2, 2);
  let divMult = 1 + 2 * 2 + 4 / 2;
  &quot;Brackets: 2 * (1 + 1) should be 4, result: &quot; + brackets + 
  &quot;\n&quot; + &quot;Order: 1 + 2^2 should equal 5, result: &quot; + order + &quot;\n&quot; + 
  &quot;Division and Multiplication: 1 + 2 * 2 + 4 / 2 should equal 7, result: &quot; + divMult
  </code></pre>
  <p>Spoiler alert: it does.
  <a href="https://i.sstatic.net/uNmNX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/uNmNX.png" alt="result of entering the expression in a text layer, showing correct results for BODMAS" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-21T01:54:53.407Z
Answers.LastActivityDate: 2021-01-21T02:01:14.803Z
Answers.LastEditDate: 2021-01-21T02:01:14.803Z
Answers.UserDisplayName: stib
Body: <p>In algebra the well-known BODMAS acronym represents the priority / order that operations are calculated in:</p>
  <ol>
  <li>Brackets</li>
  <li>Order</li>
  <li>Division</li>
  <li>Multiplication</li>
  <li>Addition</li>
  <li>Subtraction</li>
  </ol>
  <p>When writing expressions in After Effects, will operations follow this order, or in what order are they calculated?</p>
  
Tags: <after-effects><after-effects-expressions>
Title: Does After Effects expressions follow BODMAS
UserDisplayName: AutoBaker
ThreadText: # Does After Effects expressions follow BODMAS
  
  (Asked by: username_0 on 2021-01-18)
  
  In algebra the well-known BODMAS acronym represents the priority / order that operations are calculated in:
  
  1. Brackets
  2. Order
  3. Division
  4. Multiplication
  5. Addition
  6. Subtraction
  
  When writing expressions in After Effects, will operations follow this order, or in what order are they calculated?
  
  **Tags:** after-effects, after-effects-expressions
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-01-21. Score: 1 | Accepted answer
  
  After Effects (as of version 16, released 2020) uses the V8 Javascript engine to interpret expressions. This is the same as used in many web browsers, such as Chrome.
  
  It's pretty easy to test if it follows BODMAS (The **O** in which stands for **Order** BTW). On a text layer `alt / opt`-click the stop watch for text source and paste this:
  
  ```
  let brackets = 2 * (1 + 1);
  let order = 1 + Math.pow(2, 2);
  let divMult = 1 + 2 * 2 + 4 / 2;
  "Brackets: 2 * (1 + 1) should be 4, result: " + brackets + 
  "\n" + "Order: 1 + 2^2 should equal 5, result: " + order + "\n" + 
  "Division and Multiplication: 1 + 2 * 2 + 4 / 2 should equal 7, result: " + divMult
  
  ```
  
  Spoiler alert: it does.
  [![result of entering the expression in a text layer, showing correct results for BODMAS](https://i.sstatic.net/uNmNX.png)](https://i.sstatic.net/uNmNX.png)
  
  
  ---
  
  