hold, drag and catapult an object

hi! can you help me? i want to make functionality of the game like Angry birds and i has a problem. How I can hold, drag and catapult the object? if you can, write please the code in javascript.

I would check how far the player has moved the end of the catapult, and add force to a rigidbody, multiplied by the distance pulled back.