fromUrl loads data asynchronously. If you want to access the data after loading, use the loadUrl method, and use .then to have your function called when the data is loaded.
var dataSource = new Cesium.GeoJsonDataSource();
dataSource.loadUrl(’…/…/SampleData/ne_10m_us_states.topojson’).then(function() {
console.log(dataSource.entities.entities);
});
viewer.dataSources.add(dataSource);