title: If statement in a callback not executing properly (Javascript)
body: <p>I am using a callback method to wait for an ajax request to complete that checks if a different person has locked an item.</p>
  <p>The callback method simply waits for the ajax request to complete, then pushes the resultant message into the html.</p>
  <p>Here is the ajax function:</p>
  <pre><code>        function checkLockAndPushModalMessage(url, evaluationId, userIsObserver, callback) {
              console.log('we are in checkandpush');
              url = url + evaluationId + &quot;/&quot;
              $.ajax({
                  url: url,
                  type: 'GET',
                  beforeSend: function (xhr, settings) {
                      xhr.setRequestHeader(&quot;X-CSRFToken&quot;, csrftoken);
                  },
                  success: function (data) {
                      if (userIsObserver){
                          console.log('user is observer (in success in check &amp; push)')
                           if (data.employee_locked === true) {
                               callback(true);
                          } else {
                               callback(false);
                          }
                      }
                      if (!userIsObserver) {
                          console.log('user is non-observer (in success in check &amp; push)')
                          if (data.admin_locked === true) {
                               callback(true);
                          } else {
                               callback(false);
                          }
                      }
                  },
                  error: function(jqxhr, textStatus, errorThrown) {
                      // TODO: Handle errors
                      console.log('There was an issue determining if the other use has locked the evaluation!');
                  },
              })
          };
  </code></pre>
  <p>The callback method is this:</p>
  <pre><code>        function messageToModal(userHasLocked) {
              let isLocked = userHasLocked;
              console.log('in messageToModal');
              console.log('other user has locked is: ' + userHasLocked);
              console.log('isLocked is: ' + isLocked);
              console.log(typeof userHasLocked);
              if ('foo' != 'bar') {
                  // This evaluates fine and logs in console
                  console.log('Foo is NOT Bar!')
              }
              let modal_message = &quot;NO NO NO&quot;;
              if (isLocked === true) {
                  // The other user has locked the evaluation
                  let modal_message = &quot;The other user has locked this evaluation.&quot;;
              }
              if (isLocked != true) {
                  // The other user has not locked the evaluation
                  let modal_message = &quot;The other user has not locked this evaluation.&quot;;
              }
              // Push the message letting them the know the other users locked status to the modal
              console.log('gotta push the message now: '+ modal_message);
              $(&quot;#lockControlMessage&quot;).text( modal_message );
          }
  </code></pre>
  <p>And I call it like this:</p>
  <p><code>checkLockAndPushModalMessage(evaluationUrl, evaluationData.id, userIsObserver, messageToModal);</code></p>
  <p>There is a lot of 'dummy data' in there just so I can see what is happening and where we're at in the console.</p>
  <p>The other if statement I have in there works as you would expect.</p>
  <p>The console looks like this:</p>
  <p><a href="https://i.stack.imgur.com/nDxcd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nDxcd.png" alt="console_image" /></a></p>