# // this piece of code is included in the documentation
# use arrow_udf_runtime::javascript::{FunctionOptions, Runtime};
# use arrow_schema::{DataType, Field, Schema};
# use arrow_array::{RecordBatch, Int32Array};
# use std::sync::Arc;
# let mut runtime = Runtime::new().await.unwrap();
# runtime
# .add_function(
# "gcd",
# DataType::Int32,
# r#"
# export function gcd(a, b) {
# while (b != 0) {
# let t = b;
# b = a % b;
# a = t;
# }
# return a;
# }
# "#,
# FunctionOptions::default().return_null_on_null_input(),
# )
# .await
# .unwrap();
# runtime
# .add_function(
# "series",
# DataType::Int32,
# r#"
# export function* series(n) {
# for (let i = 0; i < n; i++) {
# yield i;
# }
# }
# "#,
# FunctionOptions::default().return_null_on_null_input(),
# )
# .await
# .unwrap();