Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8574273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:26:15+00:00 2026-06-11T19:26:15+00:00

Hello I want to extract elements from both arrays with the same url .How

  • 0

Hello I want to extract elements from both arrays with the same url .How can i loop these two arrays and get their content, because it gives me undefined for the news_url and i think it outputs twice the items in the console.

function geo(news_array,user_tweets){
    console.log(news_array,user_tweets);
    for (var x=0; x<user_tweets.length; x++) {
        var user = user_tweets[x].user;
        var date = user_tweets[x].date;
        var profile_img = user_tweets[x].profile_img;
        var text = user_tweets[x].text;
        var url=user_tweets[x].url;
        second(user,date,profile_img,text,url);
    }
    function second(user,date,profile_img,text,url){
        for (var i = 0; i < news_array.length; i++) {
            var news_user = news_array[i].news_user;
            var news_date = news_array[i].news_date;
            var news_profile_img = news_array[i].news_profile_img;
            var news_text = news_array[i].news_text;
            var news_url=news_array[i].url;
            if (url==news_array[i].news_url) {
                geocode(user,date,profile_img,text,url,news_user,news_date,news_profile_img,news_text,news_url);
            }
        }
    }
    function geocode(user,date,profile_img,text,url,news_user,news_date,news_profile_img,news_text,news_url) {
        console.log(url,news_url);
            }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:26:16+00:00Added an answer on June 11, 2026 at 7:26 pm

    The problem is
    in news_tweets function, you add news_url to news_array. So you should call

    news_array[i].news_url

    in second function.

    I modify your code as

    1. news_url: (item.entities.urls.length > 0)?item.entities.urls[0].url : '' in news_tweets function
    2. add close brace } for geo function and remove } from last
    3. add new_array parameter to second function like second(user, date, profile_img, text, url,news_array);

    Modify code can be tested in http://jsfiddle.net/rhjJb/7/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to extract all the elements of a list from the first non-numeric
I want to extract any string after 'user=' from the string '/?user=hello&user=man&user=' . In
I want to extract the path from GetModuleFileNameW and then to append \hello.dll to
Hello want to know if i can get some help on this as i
hello i want to get startet with programming with WIN32, therefore i wrote a
Hello I want print numbers from 30 to -30, this is my code #include
i want to extract number and add these numbers using Java and String remain
Hello I have the following php code, from the output $doc I want to
I am getting ajax response in array format from php url. How to extract
Hello I have a html string, with tags for every image. I can extract

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.