Hi Guys,
So I’m going back over some Javascript fundamentals because I feel like I’m not grasping the specify, ideate, and implement principles right.
I find myself sticking to my favorite operators/methods.
For instance,
I love the ternary operator…so I used that.
Example:
inRange(x, y, z){
z === undefined ? [z, y] = [y , 0] : z;
y > z ? [y , z] = [z, y]: y;
let isInRange = y <= x && x < z ? true : false;
return isInRange;
};
Besides the “if” conditional statement, are there any other ways to implement this method?
I would love some of the insight on how to improve on specifying functionality and ideate game plans.