Create shortcode to echo javascript

First of all, it looks like you are trying to enqueue version 2.2.4 of jquery, under the condition that jquery has already been loaded. That doesn’t look good.

Secondly, you can’t just echo a script in a shortcode. You must add it to another script using wp_add_inline_script. Like this:

function wpse238227_custom_shortcode23() {
    wp_enqueue_script('script-typed', 'https://www.example.comwp-content/themes/mediso-v1-03/typed.js', array('jquery'));
    // script needs to be added
    $script_to_add = 'jQuery(function ($) { $(".element-typing").typed({ strings: ["This is my typing text"], typeSpeed: 20 }); });';
    wp_add_inline_script ('script-typed', $script_to_add);
    // the html needs to be returned
    return "<p class="element-typing"></p>";
}
add_shortcode( 'typed23', 'wpse238227_custom_shortcode23' );

Note that this script will be added to the footer, because by the time WordPress is evaluating the shortcode in the content, the head of the site has already been assembled. You may also want to read more about enqueueing scripts from shortcodes in general.