# Creating and "if" statement that activates

Hello guys, I been trying for 3 days making this code to work but cleared I couldnt pass trough this step so I was wondering if anyone could teach me how to create an “if” statement that activates with ceratins numbers.

(my code

`````` let arr =[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
for(var i=0; i < arr.length; i++){
console.log(i);
}
``````

alright explain the thing you want

``````let arr =[];
for(i=1;i<=15;i++)
arr.push(i);
for(let i=0;i < arr.length;i++)
{

if (arr[i] >= 3 && arr[i] <= 7)

{console.log(arr[i]);
}}
``````

Now, I have another problem xD. See, now I have use the same code but in this case it suppost the code have to shows certain values: 1,2,8,10,10,11,12,13,14,15. How? I dont know I did it!!!

``````let arr =[];
for(i=1;i<=15;i++)
arr.push(i);
for(let i=0;i < arr.length;i++)
{

if (arr[i] >=1  && arr[i] <= 2 || arr[i] >=8 && arr[i] <=15)

{console.log(arr[i]);
}}
``````

I had a crazy night last night, my head is hurt xD

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