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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:31:47+00:00 2026-06-12T20:31:47+00:00

Am I correct in assuming that when the first if statement and nested if

  • 0

Am I correct in assuming that when the first if statement and nested if within the else statement both fail, I then go back up to the first for loop and increment i by 1?

So I can continue until j < totalCols fails even though neither the if or else statement are executing?

var rowCount = [];
for (var i = 0; i < totalRows; i++) {
   rowCount[i]="";
   spaceCount = 0;

   for (var j = 0; j < totalCols; j++) {
      if (puzzle[i][j] == "#") { // if this fails?
         spaceCount++;
         if (j == totalCols-1) rowCount[i] += spaceCount + "&nbsp;&nbsp;"; 
      } else {
         if (spaceCount > 0) { //and this fails?
            rowCount[i] += spaceCount + "&nbsp;&nbsp;";
            spaceCount = 0;
         } 
      }    
   }

}
  • 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-12T20:31:48+00:00Added an answer on June 12, 2026 at 8:31 pm

    No, if either of those if statements fails, you are still in the inner loop that is incrementing j. In order to get out of the inner loop you need to use the break statement.

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

Sidebar

Related Questions

Am I correct in assuming that if you have an object that is contained
Short one: Am I correct in assuming, that the Samsung Galaxy S wifi 4.0
Assuming that is even the correct term, what's the deal with them? jQuery(#removeUser, jQuery(myform)).click(
Given certain multibyte character sets, am I correct in assuming that the following doesn't
First, I'm assuming that calling any function of std::chrono is guaranteed to be thread-safe
I'm working on my first web site that requires SSL, it's hosted on a
The problem seems simple at first: just assign an id and represent that in
Assuming I have two methods. One that creates an arraylist and returns it, the
We have two cron jobs that hit two different dynamic backends and both are
Correct me If I am doing wrong, I have just started to check WCF

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.