Accessing data in handlebars file

How to access a variable in handlebars file that is declared in a JavaScript file. Accessing as below doesn’t work.

In JavaScript file(script.js):

(function() {
  var dataForCreate = "Create";

In Handlebar file(sample.hbs):

<!doctype html>
    <script src="script.js"></script>
    <button id="createBtn">{{dataForCreate}}</button>

If you’re in JS, try something like this (assuming you’re traversing some of the sample app source code where express-hbs is used):

var hbs = require('express-hbs');

hbs.registerHelper('dataForCreate', function(foo) { return "Create"; });