How do you know someone has cognitive impairment which makes it difficult to use JS-heavy sites and/or is using an older device which has performance issues with heavy sites?
Answer: Don't worry, they just won't be able to use your site.
The same could be said about the use of images on a site.
The solution is to develop sites with accessibility in mind. Use a screen reader; experience what ALL your users will experience. Experiment with various rendering tools to emulate color blindness.
There are even more tools to performance tune your website.
This all comes down to the site author taking the time to cater to as many users as possible. It is not inherently a problem with the use of JavaScript, or dynamic elements.
So, yeah, there are a lot of shitty websites out there. Folks that choose to deliberately cripple their browser are more likely to see these shortcomings.
But if we're talking about text-based websites that are basically brochures, all you have to do it fill in the alt attribute. Nobody is asking anyone to make their website of paintings cater to the blind, it's a strawman position.
<<The solution is to develop sites with accessibility in mind.
Hmm. No.
I think other poster wrote something to the effect of 'once something becomes popular and adopted by the masses, it ceases to be the ideal believers once strived for'.
If anything, it would appear that when you attempt to please everyone, you have to trade-off in places that some users may find unacceptable.
Answer: Don't worry, they just won't be able to use your site.