Indu Pillai The first step I would suggest is to learn when NOT to use JavaScript at all... since if you care at ALL about usability and accessibility your first step should be to build a website that gracefully degrades, and an essential step of graceful degradation is that a site at least be able to deliver it's content scripting off. Losing some flashy bits like comments or whatnot is one thing, but if the core functionality is broken without scripting, you didn't do your job. This is why client-side rendering is more often than not incompetent nonsense when it's used as the ONLY content delivery method.
GOOD scripting should enhance the functionality of an already working page. For example if you had a proper form for submitting a response that already worked, you could then hook it with scripting to AJAX and insert instead of the POST/GET method, BUT LEAVE THE FALLBACK IN PLACE.
There's also just so much stuff people blindly dive for the JavaScript for when there's no good reason. See using JavaScript for dropdown menus when we've not needed JS for that since IE6, and even then that was better handled by using a .htc jScript polyfill than resorting to "JS for everything". Nowadays a poster child for "JS for nothing" is the mobile hamburger menu, something that know-nothings behind garbage like bootcrap will use a BUTTON tag, and assload of DIV and SPAN, and some scripting to handle, when a INPUT type="checkbox" and an empty LABEL can do the job with CSS handling the heavy lifting!
The laugh is you say add a checkbox input the people defending the scripttard approach will go "but that leaves a stray checkbox scripting/css off" -- 1) as if that's any different from their stupid BUTTON tag and 2) usually from the people who say don't worry about people without JavaScript... It's like "You can't have it both ways ***holes!"
But that's treading into where people just start making up lame excuses to justify ignorance, incompetence, or just plain stupidity. See the three high paid executives (CEO, CTO, Marketing Director) I just got fired from a large banking group I was freelancing for as I went from "guy being brought in to supervise fixing things" to "witness for the prosecution". I got them clear of the court cases, everything was kosher, and NOT EVEN TWO DAYS after I was done, they went in and screwed it over on every accessibility count that had them in the courts in the first damned place -- so now they're facing DOUBLE fines. The LAME EXCUSES about "oh don't worry about JavaScript off" or "users of whatever are only 3%" and so forth came spewing forth which is why the courts in three countries are not giving them any grace period to come up to WCAG 2 minimums. They went from "oops we didn't know" to "willfully disobeying a court order".