Best method name: .setPos() or tryPos()?

Hi folksies!

I currently have a class TOOLTIP.

tooltip.setPos(xPos, yPos); attempts to set position of tooltip to provided parameters but if parameters would cause the tooltip to fall outside of the viewport it is positioned so it stays inside the viewport.

Is there a better name for the method .setPos()? Perhaps .tryPos()? But then the fact that the method will set an x and y coordinate for the tooltip is somewhat obscured.

Thank you!

You don’t get charged extra in JavaScript to use full words. Why not setPosition or create a Getter and Setter?

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.