title: Ternary operator inside an object in JS
body: <p>I'm creating a React app, and I have a code segment that looks like this:</p>
  
  <pre><code>import React, { Component } from 'react';
  import { RaisedButton } from 'material-ui';
  
  let isZero = false;
  
  class Button extends Component {
      render() {
          const { value } = this.props;
  
          isZero = false;
          if (value === 0) {
              isZero = true;
          }
  
          // removed for brevity
      }
  }
  
  const styles = {
      otherStyles: {
          minWidth: isZero ? '120px' : '60px',
          margin: '5px 5px 5px 0',
          lineHeight: isZero ? '120px' : '60px',
      },
  };
  
  export default Button;
  </code></pre>
  
  <p>But, apparently the conditional statement is not applied inside the object, as when <code>value</code> is 0, I still get the <code>60px</code> instead of <code>120px</code>. Any ideas?</p>