How to save a string/object to firebase database

Noob question… Using JS, how do I save a string or object to firebase database? I’m trying to do this on codepen.io. I’ve tried this:

// Initialize Firebase app

const firebaseConfig = {
  // your app config here
};

firebase.initializeApp(firebaseConfig);

// Get a reference to the database

const database = firebase.database();

// Write a string to the database

const myString = "Hello, Firebase!";

database.ref('myData').set(myString);

But I’m not seeing anything added in the firebase console… What steps am I missing.