how to read and show json 2d array using getJSON?

how to read and show json 2d array using getJSON?

JSON file example is..

JSON file example is..

[{"name" : "메뉴1", "permission" : "1", "link" : "http://naver.com"},
{"name" : "메뉴2", "permission" : "2", "link" : "http://daum.net", "sub" : [
    {"name" : "메뉴2-1", "permission" : "1", "link" : "http://google.com"},
    {"name" : "메뉴2-2", "permission" : "1", "link" : "http://yahoo.com"}
]}]

I want to put a secondary menu at the bottom of the primary menu. I know how to show 1d array but I can't show 2d array. Please help me.

    <script>
$(document).ready(function() {
  {
    $.getJSON('./inc/menu.json', function(data) {
      var html = '';
      html += '<ul>';
      $.each(data, function(entryIndex, entry) {
          html += '<li><a href=' + entry.link + ' title=' + entry.permission  + '>' + entry.name + '</a></li>';
      });
      html += '</ul>';
      console.log(html);
      $("nav").html(html);
    });
    return false;
  }
});
</script>


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

JSON Tutorial For Beginners | What is JSON | Learning JSON with JavaScript

JSON Tutorial For Beginners | What is JSON | Learning JSON with JavaScript

Javascript | How To Covert Javascript Array To JSON

In this example, we will see How To Covert Javascript Array To JSON. We can convert Javascript array to json using JSON.stringify() method. At some point in your time, whatever developer you are, you need to deal with JSON data. JSON stands for Javascript Object Notation. Exchange data between client and server is straightforward using JSON.

Understand and Use JavaScript's .forEach() vs. jQuery's .each()

There are two functions to deal with an array on the client-side – JavaScript's .forEach() and jQuery's .each(). Here, I will teach you how to use both of these methods with some sample code.