Total number of nodes

i have a scenario in which i need to know total no of nodes in a diagram instead of parsing the diagram json does go js provide a built in function to do so?


also is there a way to change a single property of all the nodes ?
for reference consider there are 4 node each have a shape and a fill property i want to change the fill of all to “red”.

nvm found the answer in data binding thanx anyways