To make sure I have your question right, it looks like you are trying
to use a function that you wrote in a javascript file directly in
your html file, but you are having an issue with it coming back as
undefined.
In testing it I found that as long as the fct function in your .js is global then it will work, but there is another problem with your example in the HTML ( but it may just be a typo because it's an example)
You put the script src for the .js file in above the in-inline js correctly, but then in the inline js script tag you say:
fct.some.property = function(){}
The problem with this is .some
is not defined yet, so you can't attach a property to it yet. Try:
fct.some = {} // empty object
fct.some.property = function(){}
EDIT: So, this works on repl.it, but it won't work in the stackoverflow snippet editor. In the snippet editor it gives me the same error as you are getting. Odd.
let fct = function() {
}
<!DOCTYPE html>
<html>
<head>
<link href="index.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script src="index.js"></script>
<script>
console.log(fct)
fct.some = {}
fct.some.property = function() {
return 7
}
console.log(fct.some.property())
</script>
</body>
</html>