title: Adding to an array from another file - node.js
body: <p>So i am new to coding and i'm trying to add users info to my array that's in a different file.</p>
  <p>But when i add a dummy user for testing something weird happens. If i add the dummy user with the id 00000 the id gets added as 0 when it should be 00000.</p>
  <p>My main index.js file:</p>
  <pre><code>const users = require('./models/users.js');
  
  // Test To Check Users
  setInterval(() =&gt; {
    console.log(users.getuser());
  }, 2000);
  
  // Add Dummy Users For Test
  setTimeout(() =&gt; {
    users.adduser({
      'username': 'user add one',
      'id': 00000
    });
  
    users.adduser({
      'username': 'user add two',
      'id': 565656
    });
  }, 2000);
  </code></pre>
  <p>My model users.js file:</p>
  <pre><code>let onlineUsers = [{
    'username': 'user one',
    'id': 123
  },{
    'username': 'user two',
    'id': 321
  }];
  
  const users = {
    getuser: function() {
      return onlineUsers;
    },
    adduser: function(data) {
      if (onlineUsers.some((user) =&gt; user.username != data.username)) {
        onlineUsers.push(data);
      }
    },
    removeuser: function(data) {
      if (onlineUsers.some((user) =&gt; user.username == data.username)) {
        onlineUsers = onlineUsers.filter((user) =&gt; user.username != data.username);
      }
    }
  };
  
  module.exports = users;
  </code></pre>
  <p>I hope someone can maybe tell me why the id adds / logs as 0 when it should be 00000?</p>
  <p>Console log:</p>
  <pre><code>[
    { username: 'user one', id: 123 },
    { username: 'user two', id: 321 },
    { username: 'user add one', id: 0 },
    { username: 'user add two', id: 565656 }
  ]
  </code></pre>
  <p>Sorry if my english is not good.</p>