I have the following array in my smart contract:
string[] public saved_texts;
function getSavedTextsCount() public constant returns(uint) {
return saved_texts.length;
}
I created getSavedTextsCount
to basically get the length of my array.
My web3
function looks like the following:
basicInfoUpdate: function () {
TextContract.deployed().then(function (instance) {
let element = ''
for (let index = 0; index < instance.getSavedTextsCount; index++) {
element += instance.saved_texts.call(index)
element += '</br>'
}
document.getElementById('transactions').innerHTML = element
})
},
However, I do not get any result back. Any suggestions what I am doing wrong?
I appreciate your replies!