How to return a value from a jasmine spy

Return­ing a value from your jas­mine spy is extremely sim­ple. Just do the fol­low­ing jasmine.createSpy().and.returnValue(value);