Your very own "for" instruction Your very own "for" instruction

Assuming you have the following input : a, b, c, d

Input can be in one-line using any format "a/b/c/d" or "a,b,c,d" etc..

You can also have 4 inputs.

You must code the following behaviour (pseudo-code here) :

var i = &lt;a&gt;
while (i &lt;b&gt; &lt;c&gt;)
    print i
    i = i + &lt;d&gt;
    print "\n"


Here are some tests cases :

input : 1,&lt;,10,1
output :
1
2
3
4
5
6
7
8
9


One more :

input : 20,&gt;,10,1
output :
20
21
22
23
24
25
26
27
...
infinite loop / program crashes



a is an integer, the initial value of i.
b is a string or a char, it can't be something else, the comparator used in the ending condition of the
for loop.

b can and must be one of the following strings :

- "&gt;"
- "&lt;"

c is an integer, the number used in the ending condition of the for
loop.
d is an integer that is added to i at every loop.


This is code-golf, the shortest answer wins !
JavaScript (ES6), &nbsp;44&nbsp; 43 56 bytes

Saved 1 byte thanks to ETHproductions
Edit: fixed to comply with output requirements

(a,b,c,d)=&gt;{for(s='';eval(a+b+c);a+=d)s+=a+`
`;alert(s)}


Test



let f =

(a,b,c,d)=&gt;{for(s='';eval(a+b+c);a+=d)s+=a+`
`;alert(s)}

f(1,'&lt;',7,2)