what is the right way to delete all features from featureLayer
Try making a REST delete features call with a where clause "1 = 1" or something similar.
Use featureLayer.selectFeatures() with, as Kirk suggested, a where clause that will return all your features. Once you have all your features, pass them to applyEdits() as the deletes.