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 8940327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:00:30+00:00 2026-06-15T11:00:30+00:00

Possibly a silly question, and i’m not sure how to phrase it. I have

  • 0

Possibly a silly question, and i’m not sure how to phrase it.

I have an array in a function and I want put it through a loop print the text, not the variable. I’ve just starting banging my head on this, but whats really getting me is how to only print lets say the “category” and value if the value is not empty. Here’s and example to show, The outcome i’m looking for is “u =1 and x = 1 AND z = 3”. If anyone could point me in the write direction, it would be most helpful.

(categories called from multiple selection menus in text)
s=
t=
u=1
v=
w=
x=1
y=
z=3
function example(s,t,u,v,w,x,y,z) {

    selection=[s,t,u,v,w,x,y,z];
    for (var i=0;;i++)
    {
        if (!selection[i]) {
            selection="";
        }
        else
        {
            selection= selection + 
        };
    }
}

The outcome i’m looking for is
“u =1 and x = 1 AND z = 3”

  • 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-15T11:00:31+00:00Added an answer on June 15, 2026 at 11:00 am

    I will provide semi functional code since I am not at my work desk. Assuming your variables are declared as parameters or as plain variables somewhere. You can declare a the names of variables as an array, loop over the array and use the eval function to evaluate their value

    selection=["s","t","u","v","w","x","y","z"];
    output = "";
        for (var i=0; i < selection.length; i++)
        {
            value = eval(selection[i]);
            if (value==""){
               //nothing to do
             }
            else
            {
              output += selection[i] + "=" + value; 
            };
         }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm back with another (possibly) silly question. sorry. I have a pretty complicated query
Perhaps it is a silly question but I want to be sure about it.
This might be a silly question, but I'm not sure how to tackle the
Maybe a silly question, I just hope not... I have a SaaS application and
Possibly a silly question, but I'm having no luck finding an answer. Using Visual
There is another possibly related question on this but it didn't have answers and
This may be a silly question but... Say you have a sentence like: The
This might seems silly question but for me it is annoying. I have installed
This is possibly a silly question, but do I need to use and assignment
I have a silly question. Just wanted to know if it is possible. I

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.