ArcGIS REST API vs JavaScript API

Discussion created by jo_rahul on Oct 24, 2013
Latest reply on Oct 24, 2013 by jo_rahul
Am new to ArcGIS and still learning.   My question is what is the difference between using REST API vs JavaScript API?

Given an ArcGIS Server and availability of these API's and say for example I need to provide a way for the user in my web application to draw a polygon on the map, how do I do that using REST API?. 

Based on what I have read so far, JavaScript API provides a draw toolbar that can be used along with the related JS API however unclear on how REST API can be used.