Nowthemainideabehindmodulesisallowingyoutoimportandexportdifferentsections a codefromdifferentfilesintootherfiles, whichallowsyoutobreakapartyourcodeintomoresmallergrainfiles, whichmakesyourcoateasiertounderstandandreasonwithlateron, whenyouhavetochangeit.
Sotostart, I have a simpleclasscalleduserthathas a bunchofinformationabout a userthathas a userclassandtwofunctionsforprintingtheuser's nameandprintingtheuser's age.
Butwhenyou'reimportingthingsinjavascript, youneedtomakesurethatyouputinfrontofit a dotslashifyou'rewantedtouserelativepathsorjust a singleslashifyouwanttouseanabsolutepath.
Andnowifyousaythat, weseeoureragoesawayandthistellsourbrowserthatwe'reusingmodulesinsideofthisJavascriptfileandbydefiningthetypeofmoduleitalsodefaultsarefiletousethe D forattributesforloadingit.
Andifyoudon't knowabout D forand a sinkattributesforloading, makesuretocheckoutmyJavaScriptvideoon D forand a sink, whichisgoingtobelinkedinthecardsandthedescriptionbelow.
So, forexample, ifwehadanotherscriptthatincludedallofthiscodefromMaineDodge S andallthecodefromuserdotJsintowonefilewecouldimportthatinhereusingthisnomoduleattributes.