How to grab characters from Multi-dimensional array?

The thing I want to do is, when you click on a movie title you get detail data about the movie, when you click on a character you get detailed data on the character.


// create a keyup 
   $('#search').keyup(function (e) {    
    //getting the search value from input
var searchTerm = $('#search').val();
 //insensitive case
var exp = new RegExp(searchTerm, 'i');

 //getting the swapi film data
 $.getJSON("", function (data) {//

 //creating a output future values of data
    var output = '<ul>'  

    //iterate through data.results with $.each
    $.each(data.results, function (key, value) { 

        //if statment for searching the title, director, opening crawal
if((!= -1) || (!= -1) || (!= -1)){
 //create a list 
//output with, title, director, opening crawl and characters 
    output += '<li>';
    output+='<a href="#" id="titleVal" >'+value.title+'</a>' //need a clickable event for to get the charachters data and not just the links
 //closing the ul
    output += '</ul>'
    //output to html 

    //creating a click function
    $('a').on('click', function()
    $.getJSON("", data => {

//itarate through 
//getting the characters names 
    for (const i in data.results) {
    let x = data.results[i];

        // for (const j in x) {
        //     let b = x[j];
        //     // console.log(b);
        //     $('#info').append('<li>'+b+'</li>')
        // }


  //how do i grab characters, for each movie title
  function grabCharac (){




);//key up

}); //doc.ready

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

Please use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks are not single quotes.