> For the complete documentation index, see [llms.txt](https://scope.onepub.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://scope.onepub.dev/fundamentals/scope/returning-values.md).

# Returning values

You can return a  value from a Scope's run method.

```dart
import 'package:scope/scope.dart';

void main() {

  /// buld the scope
  final greeter = (Scope()
     ..value<String>(greetingToken, 'Hello')
     ..value<int>(emphasisToken,  1))
     /// run code in the scope getting the return value
     .run<Greeter>(Greeter());

  /// use the returned value  
  greeter.greet('world'); // `greeter` can now be used outside of the scope
                          // but will have no access to scope keys.
}
```

***
