Wikipedia API- Stuck

Wikipedia API- Stuck
0.0 0

#1

Hello. I have the API displaying information, which I am testing by displaying as my header. I am lost as to what the next step would be to display this information as links on the page in order. Could someone please provide me with a hint?


#2

What data structure is the data stored in when the response comes back from the API?
If I enter 'JavaScript" into the search box of your code, the following is what data looks like:

['Javascript', ['JavaScript',
        'JavaScript syntax',
        'JavaScript engine',
        'JavaScript InfoVis Toolkit',
        'JavaScript Style Sheets',
        'JavaScript library',
        'JavaScriptMVC',
        'JavaScript templating',
        'JavaScript framework',
        'JavaScript OSA'
    ],
    ['JavaScript (), often abbreviated as JS, is a high-level, interpreted programming language. It is a language which is also characterized as dynamic, weakly typed, prototype-based and multi-paradigm.',
        'The syntax of JavaScript is the set of rules that define a correctly structured JavaScript program.',
        'A JavaScript engine is a program or interpreter which executes JavaScript code. A JavaScript engine may be a traditional interpreter, or it may utilize just-in-time compilation to bytecode in some manner.',
        'The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web.',
        'JavaScript Style Sheets (JSSS) was a stylesheet language technology proposed by Netscape Communications Corporation in 1996 to provide facilities for defining the presentation of webpages.',
        'A JavaScript library is a library of pre-written JavaScript which allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies.',
        'JavaScriptMVC is an open-source rich Internet application framework based on jQuery and OpenAjax. It extends those libraries with a model–view–controller architecture and tools for testing and deployment.',
        'JavaScript templating refers to the client side data binding method implemented with the JavaScript language.',
        'A JavaScript framework is an application framework written in JavaScript. It differs from a JavaScript library in its control flow: a library offers functions to be called by its parent code, whereas a framework defines the entire application design.',
        'JavaScript OSA, (originally JavaScript for OSA, abbreviated as JSOSA), is a freeware inter-process communication scripting language for the Macintosh computer.'
    ],
    ['https://en.wikipedia.org/wiki/JavaScript',
        'https://en.wikipedia.org/wiki/JavaScript_syntax',
        'https://en.wikipedia.org/wiki/JavaScript_engine',
        'https://en.wikipedia.org/wiki/JavaScript_InfoVis_Toolkit',
        'https://en.wikipedia.org/wiki/JavaScript_Style_Sheets',
        'https://en.wikipedia.org/wiki/JavaScript_library',
        'https://en.wikipedia.org/wiki/JavaScriptMVC',
        'https://en.wikipedia.org/wiki/JavaScript_templating',
        'https://en.wikipedia.org/wiki/JavaScript_framework',
        'https://en.wikipedia.org/wiki/JavaScript_OSA'
    ]
]

The above is an array with four element with the first element containing the search phrase ‘JavaScript’ and then followed by 3 other elements ( nested arrays each containing 10 elements). If you read the API documentation for the endpoint you are using, you will find, the 2nd element contains an array of the titles of the first 10 search results for ‘JavaScript’, then 3rd element contains corresponding descriptions/summaries for the titles in the first element, and the 4th element contains urls to the corresponding Wikipedia articles of the titles in the first element.

How do you want to display this data? You must decide how you want to display the data given to you. Once you figure that out, you will need to think about how you could iterate through the array to get the information out you need. By now you have learned enough about accessed multi-dimensional arrays by completing the various array challenges in the Basic JavaScript and Basic Algorithms sections.


#3

Thank you so much! This is what I was looking for!