'use strict'; function fn () { return 'hello'; } const fns = fn.toString(); if (fns.indexOf('return') >= 0) { console.log('ok'); }