title: How to get the whole json object using fetch or axios?
body: <p>This is my Json file data.json i want this data to be fetched by either fetch or axios and return the data to variable</p>
  <pre><code>{&quot;list&quot;:[
    {
      &quot;rank&quot;:&quot;1&quot;,
      &quot;points&quot;:&quot;1025&quot;,
      &quot;name&quot;:&quot;John Doe&quot;,
      &quot;age&quot;:&quot;27&quot;
   },
   {
     &quot;rank&quot;:&quot;3&quot;,
     &quot;points&quot;:&quot;245&quot;,
     &quot;name&quot;:&quot;Elizabeth&quot;,
     &quot;age&quot;:&quot;17&quot;
   },
   {
      &quot;rank&quot;:&quot;2&quot;,
       &quot;points&quot;:&quot;566&quot;,
       &quot;name&quot;:&quot;Samantha&quot;,
       &quot;age&quot;:&quot;22&quot;
   }]}
  </code></pre>
  <p>I want this Whole data assigned to a variable
  the Output should be</p>
  <pre><code>const data=   {&quot;list&quot;:[
          {
           &quot;rank&quot;:&quot;1&quot;,
           &quot;points&quot;:&quot;1025&quot;,
           &quot;name&quot;:&quot;John Doe&quot;,
           &quot;age&quot;:&quot;27&quot;
         },
         {
          &quot;rank&quot;:&quot;3&quot;,
          &quot;points&quot;:&quot;245&quot;,
          &quot;name&quot;:&quot;Elizabeth&quot;,
          &quot;age&quot;:&quot;17&quot;
         },
         {
          &quot;rank&quot;:&quot;2&quot;,
          &quot;points&quot;:&quot;566&quot;,
          &quot;name&quot;:&quot;Samantha&quot;,
         &quot;age&quot;:&quot;22&quot;
          }]}
  </code></pre>