title: If / Else in forEach is only adding paragraph and not headlines, but locally it is working (React and Editor.js)
body: <p>I hope that someone will be able to help me with my question. 
  Lately i have tried to rebuild my dashboard to React so that i could use the Editor.js for my blog content instead of just a textarea.</p>
  
  <p>I am using <a href="https://editorjs.io/" rel="nofollow noreferrer">Editor JS</a> as an editor to write my blogpost content in, and on my local machine it is working like a dream. What i am doing is that i write an article and when i click Create in the dashboard, i run the .Save() function from Editor.js. This gives me an array with all the content from the editor and a description of what type of content it is. When i receive the array, i send it to a function, where i am looping through the array and adding every item into a string, so that i can display it in my EJS blogpost file.</p>
  
  <p>On my local machine this is working like a dream. I am able to filter all of the content and add it to the string. This results in a correctly showing blogpost when i look at it afterwards. <strong>But when i upload it to my website, i am ONLY getting the paragraphs. Everything else is being filtered out</strong>.</p>
  
  <p>I hope that someone here can help me figure out why this is working locally but not when i upload it to my website. All the functions seems to be working, but it is my loop that will only detech the paragraphs and not the headlines too. So what i end up with is a blogpost with only paragraphs.</p>
  
  <p><em>As a side i can say that when i click to edit a blogpost, all the data in the editor is showing correctly, even the headlines.</em></p>
  
  <p><strong>This is my function to detech each element and add it to a string</strong></p>
  
  <pre><code>convertArrayToString (savedContentData) {
      let dataString = "";
      savedContentData.blocks.forEach(function(item, idx) {
          if (item.type === "header" &amp;&amp; item.data.level === 3) {
              dataString += '&lt;h3 class="Headline3"&gt;' + item.data.text + '&lt;/h3&gt;';
          } else if (item.type === "header" &amp;&amp; item.data.level === 1) {
              dataString += '&lt;h1 class="Headline1"&gt;' + item.data.text + '&lt;/h1&gt;';
          } else if (item.type === "header" &amp;&amp; item.data.level === 4) {
              dataString += '&lt;h4 class="Headline4"&gt;' + item.data.text + '&lt;/h4&gt;';
          } else if (item.type === "header" &amp;&amp; item.data.level === 5) {
              dataString += '&lt;h5 class="Headline5"&gt;' + item.data.text + '&lt;/h5&gt;';
          } else if (item.type === "paragraph") {
              dataString += '&lt;p class="Normal"&gt;' + item.data.text + '&lt;/p&gt;';
          } else if (item.type === "code") {
              dataString += '&lt;pre&gt;&lt;code class="hljs"&gt;' + item.data.code +'&lt;/code&gt;&lt;/pre&gt;';
          }
      });
      return dataString;
  }
  </code></pre>
  
  <p><strong>This is my fetch post function that works locally but not correctly on my live website. Just to mention it again. It is only detecting the paragraphs and not headlines, but on the local machine it is detecting headlines as well.</strong></p>
  
  <pre><code>async onFormSubmit (e) {
      e.preventDefault();
      const savedContentData = await this.editorInstance.save();
      const contentDataString = await this.convertArrayToString(savedContentData);
      const newBlogPost = await fetch(URL + 'createblogpost', {
          method: 'POST',
          headers: {'Content-Type':'application/json'},
          body: JSON.stringify({ "blogPost": {
              "title" : this.state.title,
              "facebookTitle" : this.state.facebookTitle,
              "twitterTitle" : this.state.twitterTitle,
              "tags" : this.state.tags,
              "category" : this.state.category,
              "facebookDescription" : this.state.facebookDescription,
              "twitterDescription" : this.state.twitterDescription,
              "avatar" : this.state.avatar,
              "avatarId" : this.state.avatarId,
              "postIsPublic" : this.state.public,
              "contentRaw" : savedContentData,
              "content" : contentDataString
            }})
      });
      const newBlogPostJson = await newBlogPost.json();
      this.setState({ statusMessage: newBlogPostJson.message, resStatus: newBlogPostJson.messageType });
      this.props.updateBlogPosts();
  }
  </code></pre>
  
  <p>Just to mention it, then when you use the function .Save() from editor.js then you will get an array with all the content like this:</p>
  
  <pre><code>    {
     "time": 1550476186479,
     "blocks": [
        {
           "type": "header",
           "data": {
              "text": "Editor.js",
              "level": 2
           }
        },
        {
           "type": "paragraph",
           "data": {
              "text": "Hey. Meet the new Editor. On this page you can see it in action — try to edit this text. Source code of the page contains the example of connection and configuration."
           }
        },
        {
           "type": "header",
           "data": {
              "text": "Key features",
              "level": 3
           }
        },
        {
           "type": "list",
           "data": {
              "style": "unordered",
              "items": [
                 "It is a block-styled editor",
                 "It returns clean data output in JSON",
                 "Designed to be extendable and pluggable with a simple API"
              ]
           }
        },
        {
           "type": "header",
           "data": {
              "text": "What does it mean «block-styled editor»",
              "level": 3
           }
        },
        {
           "type": "paragraph",
           "data": {
              "text": "Workspace in classic editors is made of a single contenteditable element, used to create different HTML markups. Editor.js &lt;mark class=\"cdx-marker\"&gt;workspace consists of separate Blocks: paragraphs, headings, images, lists, quotes, etc&lt;/mark&gt;. Each of them is an independent contenteditable element (or more complex structure) provided by Plugin and united by Editor's Core."
           }
        }
     ],
     "version": "2.8.1"
  }
  </code></pre>