# Learning java, clarification needed

**URL:** <https://forum.freecodecamp.org/t/learning-java-clarification-needed/465639>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [June 19, 2021, 12:42am UTC](https://forum.freecodecamp.org/t/learning-java-clarification-needed/465639 "2021-06-19T00:42:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joelrivas4](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/joelrivas4/32/222149_2.png) [@joelrivas4](https://forum.freecodecamp.org/u/joelrivas4)\
**Post date:** [June 19, 2021, 12:42am UTC](https://forum.freecodecamp.org/t/learning-java-clarification-needed/465639/1 "2021-06-19T00:42:02Z")

</div>

How come “while(i\>=0)” is correct,  
but “while(0\<=i)” is incorrect?

```auto
+// Setup
var myArray = [];
var i=5
while(i >= 0){
myArray.push(i);
i--;
}
// Only change code below this line

```

```
  **Your browser information:**

```

User Agent is: `Mozilla/5.0 (Linux; Android 11; SM-G975U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.88 Safari/537.36`

**Challenge:** Iterate with JavaScript While Loops

**Link to the challenge:**

> **[freeCodeCamp.org](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-while-loops)**
>
> Learn to Code — For Free

---

<div class="post-metadata">

**Author:** ![caryaharper](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/caryaharper/32/209142_2.png) [@caryaharper](https://forum.freecodecamp.org/u/caryaharper)\
**Post date:** [June 19, 2021, 1:06am UTC](https://forum.freecodecamp.org/t/learning-java-clarification-needed/465639/2 "2021-06-19T01:06:46Z")

</div>

`i` can point at different things such as `1` or `2` or `3` ect. but `0` will only ever be `0` which is why you would generally have `i` on the left hand side.

Just to be clear you can write this `while(0<=i)` just fine it wont cause an error

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [June 19, 2021, 1:07am UTC](https://forum.freecodecamp.org/t/learning-java-clarification-needed/465639/3 "2021-06-19T01:07:02Z")

</div>

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.

You can also use the “preformatted text” tool in the editor (`</>`) to add backticks around text.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (’).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [December 18, 2021, 1:07pm UTC](https://forum.freecodecamp.org/t/learning-java-clarification-needed/465639/4 "2021-12-18T13:07:45Z")

</div>

Closed on December 18, 2021, 1:07pm UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
