I think there’s a typo in this lesson where the method name is insertBefore() and not beforeInsert()?
Course: Web Development: Unraveling HTML, CSS, and JavaScript - Learn Interactively
Lesson: https://www.educative.io/courses/web-development-unraveling-html-css-js/RLXn9pqYxjL