Returns the number of transactions in the specified block.
transfer:
web3.eth.getBlockTransactionCount(hashStringOrBlockNumber [, callback])
parameter:
hashStringBlockNumber
: Number|String - (optional) If no parameter is passed, the block defined by web3.eth.defaultBlock is used by default, otherwise the specified block is used.callback
: Function - callback function, used to support asynchronous execution 7.
return value:
Nubmer
- The number of transactions for a given block.
Example:
var number = web3.eth.getBlockTransactionCount("0x407d73d8a49eeb85d32cf465507dd71d507100c1");
console.log(number); // 1
Amway two tutorials: