title: Javascript promise returns unexpected token error
body: <p>Hi am trying to use request module with promise in nodeJS. </p>
  
  <p>Here is my Script</p>
  
  <pre><code>require('promise');
  var request = require('request');           
  const requestget = function (url) {
    return  new Promise((resolve, reject) {
      request(url, function (error, response, body) {
          if (!error &amp;&amp; response.statusCode == 200) {
              resolve(body);
  
           } else {
              reject(error);
           }
         });
    });
  }
  requestget('http://www.modulus.io').then(console.log);
  </code></pre>
  
  <p>but am getting the following error.</p>
  
  <pre><code>/home/xyz/reques.js:14
    return  new Promise((resolve, reject) {
                                          ^
  SyntaxError: Unexpected token {
      at Module._compile (module.js:439:25)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
      at Function.Module.runMain (module.js:497:10)
      at startup (node.js:119:16)
      at node.js:906:3
  </code></pre>
  
  <p>I really don't know what's wrong in this script any one can help me out.</p>