# 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.
{"ft_lang_label":"__label__en","ft_lang_prob":0.93230325,"math_prob":0.9427491,"size":540,"snap":"2022-40-2023-06","text_gpt3_token_len":122,"char_repetition_ratio":0.09514926,"word_repetition_ratio":0.083333336,"special_character_ratio":0.21481481,"punctuation_ratio":0.056603774,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9641458,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-01-27T04:48:28Z\",\"WARC-Record-ID\":\"<urn:uuid:45e1259f-61b7-4846-a726-0242a6728b6a>\",\"Content-Length\":\"33991\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f1e49ce4-6569-4000-a32a-53fe5b87cffa>\",\"WARC-Concurrent-To\":\"<urn:uuid:bb22f14e-795f-4618-b466-fd4b5ec02858>\",\"WARC-IP-Address\":\"64.71.144.205\",\"WARC-Target-URI\":\"https://forum.freecodecamp.org/t/creating-and-if-statement-that-activates/505081\",\"WARC-Payload-Digest\":\"sha1:A6N4QRDJHPMQO3LYGJVLSQNQQYXLMRWX\",\"WARC-Block-Digest\":\"sha1:QRQBQMNZRTO3PKH4IUVJHQFYAV3KPD6M\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764494936.89_warc_CC-MAIN-20230127033656-20230127063656-00019.warc.gz\"}"}