I am exploring how to use carto.js map in a web application. I had seen couple of samples where carto.JS is used and some of them used cartoDB by including a supporting js file in the document.
What is the difference between carto.js and cartoDB?
CartoDB is the former name of CARTO.
cartodb.js in versions < 4. Nowadays it is called
Your other samples were from before the name change.