public static Value lessThan(Session session,Value x,Value y){
  x=safeValue(x,Isolate.DEFAULT_ID);
  y=safeValue(y,Isolate.DEFAULT_ID);
  Value px=toPrimitive(session,x,PreferredType.NUMBER,x.getIsolateId());
  Value py=toPrimitive(session,y,PreferredType.NUMBER,y.getIsolateId());
  if (px.getType() == VariableType.STRING && py.getType() == VariableType.STRING) {
    String sx=px.getValueAsString();
    String sy=py.getValueAsString();
    return DValue.forPrimitive(new Boolean(sx.compareTo(sy) < 0),x.getIsolateId());
  }
 else {
    double dx=toNumber(session,px);
    double dy=toNumber(session,py);
    if (Double.isNaN(dx) || Double.isNaN(dy))     return DValue.forPrimitive(Value.UNDEFINED,x.getIsolateId());
    return DValue.forPrimitive(new Boolean(dx < dy),x.getIsolateId());
  }
}

public static Value lessThan ( Session session , Value x , Value y ) { x = safeValue ( x , Isolate . DEFAULT_ID ) ; y = safeValue ( y , Isolate . DEFAULT_ID ) ; Value px = toPrimitive ( session , x , PreferredType . NUMBER , x . getIsolateId ( ) ) ; Value py = toPrimitive ( session , y , PreferredType . NUMBER , y . getIsolateId ( ) ) ; if ( px . getType ( ) == VariableType . STRING && py . getType ( ) == VariableType . STRING ) { String sx = px . getValueAsString ( ) ; String sy = py . getValueAsString ( ) ; return DValue . forPrimitive ( new Boolean ( sx . compareTo ( sy ) < 0 ) , x . getIsolateId ( ) ) ; } else { double dx = toNumber ( session , px ) ; double dy = toNumber ( session , py ) ; if ( Double . isNaN ( dx ) || Double . isNaN ( dy ) ) return DValue . forPrimitive ( Value . UNDEFINED , x . getIsolateId ( ) ) ; return DValue . forPrimitive ( new Boolean ( dx < dy ) , x . getIsolateId ( ) ) ; } }
ecma 11 . 8 . 5 . returns true , false , or undefined .
