Greater than less than js


(Simon Rankin) #1

Could anyone tell me how I might write this correctly?

if( variable >= 13 && <= 19 ){
	hypeDocument.startTimelineNamed('someTimeline', hypeDocument.kDirectionForward)
};

I’m trying to check for numbers between 13 and 19.

Thanks in advance.

Simon


#2

The second part isn’t checking anything. Here’s what you’re saying in English.

If “X” is greater or equal to 13
And
Less than or equal to 19

That last part is missing the variable. It should be…

And
"X" is less than or equal to 19.

http://www.w3schools.com/js/js_comparisons.asp


(Simon Rankin) #3

Thanks Michael, that was killing me.

if( variable >= 13 && variable <= 19 ){
hypeDocument.startTimelineNamed('someTimeline', hypeDocument.kDirectionForward)

};