Could you preconfigure a default provider for noobs?
var web3 = new Web3(web3.currentProvider); doesn't help
web3.setProvider(new web3.providers.HttpProvider()); did it
var web3 = new Web3();
web3.setProvider(new Web3.providers.HttpProvider("http://localhost:8545"));
Don't forget to run testrpc.
Wish helpful with you.
At first,you should be run testrpc as a server.Then `Web3.providers.HttpProvider("http://localhost:8545"));`is available.
const web3 = new Web3(Web3.givenProvider);
gets you wherever Metamask is connected at the moment.
Most helpful comment
gets you wherever Metamask is connected at the moment.