Update main.js

from console.log to return result