pub fn concat(this: &Value, args: &[Value], ctx: &mut Interpreter) -> ResultValue {
    // First we get it the actual string a private field stored on the object only the engine has access to.
    // Then we convert it into a Rust String by wrapping it in from_value
    let primitive_val: String = ctx.value_to_rust_string(this);

    let mut new_str = primitive_val.clone();

    for arg in args {
        let concat_str: String = from_value(arg.clone()).expect("failed to get argument value");
        new_str.push_str(&concat_str);
    }

    Ok(to_value(new_str))
}
/// Returns a String that is the result of concatenating this String and all strings provided as
/// arguments
/// <https://tc39.github.io/ecma262/#sec-string.prototype.concat>
Returns a String that is the result of concatenating this String and all strings provided as
arguments
Returns a String that is the result of concatenating this String and all strings provided as arguments
pub fn concat(this: &Value, args: &[Value], ctx: &mut Interpreter) -> ResultValue {
    // First we get it the actual string a private field stored on the object only the engine has access to.
    // Then we convert it into a Rust String by wrapping it in from_value
    let primitive_val: String = ctx.value_to_rust_string(this);
    let mut new_str = primitive_val.clone();
    for arg in args {
        let concat_str: String = from_value(arg.clone()).expect("failed to get argument value");
        new_str.push_str(&concat_str);
    }
    Ok(to_value(new_str))
}
pub fn concat ( this : & Value , args : & [ Value ] , ctx : & mut Interpreter ) -> ResultValue { // First we get it the actual string a private field stored on the object only the engine has access to. // Then we convert it into a Rust String by wrapping it in from_value let primitive_val : String = ctx . value_to_rust_string ( this ) ; let mut new_str = primitive_val . clone ( ) ; for arg in args { let concat_str : String = from_value ( arg . clone ( ) ) . expect ( " " ) ; new_str . push_str ( & concat_str ) ; } Ok ( to_value ( new_str ) ) }
Returns a String that is the result of concatenating this String and all strings provided as
arguments
<https://tc39.github.io/ecma262/#sec-string.prototype.concat>
Returns a String that is the result of concatenating this String and all strings provided as arguments <https : // tc39 . github . io / ecma262 / #sec - string . prototype . concat >
this
&Value
args
&[Value]
ctx
&mut Interpreter
this
&Value
args
&[Value]
ctx
&mut Interpreter