These examples show the JS code embedded in HTML, which I can run in CodePen for the results. However, what I want to do is implement such as a feature layer, so I can in turn get a URL for the REST API, which in turn I can use in ArcGIS Online to add the layer. I've been going thru the docs and examples and I see nothing which explains how to do this.
What am I missing? I have the HTML, CSS and JS code in a textfile which I want to implement as a feature layer, now I am trying to figure out how. Much thanks!