Matthias,
You have to load the module first:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://js.arcgis.com/4.10/esri/css/main.css">
<script src="https://js.arcgis.com/4.10/"></script>
<script>
require([
"esri/geometry/projection",
"esri/geometry/SpatialReference",
"esri/geometry/Extent"
], function (projection,SpatialReference,Extent) {
const cs1 = new SpatialReference({
wkid: 4272
});
const cs2 = new SpatialReference({
wkid: 4167
});
const extent = new Extent({
xmin: -186.0,
ymin: -42.0,
xmax: -179.0,
ymax: -38.0
});
projection.load().then(function(evt) {
const geogtrans = projection.getTransformations(cs1, cs2, extent);
geogtrans.forEach(function(geogtran, index) {
geogtran.steps.forEach(function(step, index) {
console.log("step wkid: ", step.wkid);
});
});
});
});
</script>
</head>
<body >
Test
</body>
</html>